<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Hi all,</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">I have problems to send and see this mail at the list? Please can you check what goes wrong?</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">There was a mail with this issue a view years ago, but without a real result:</pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><a href="https://cmake.org/pipermail/cmake/2014-October/058963.html" class="">https://cmake.org/pipermail/cmake/2014-October/058963.html</a></span></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">quote:</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">————————————————————————————————————————————-
Ninja generator sets the name to objectpath.d
cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d");
WindRiver sets the dep file name to objectDir/SourceName.d, so the ".obj" in "DEP_FILE = path/BaseName.c.obj.d" must be removed
Armcc just uses base name in the same directory as the command runs, "BaseName.d". -depend_dir= can be used to control the directory for C but not asm.
The workaround is to patch the generated build.ninja
A proper solution is using new variables similar to above. (Just examples, not figured out <ARCH> etc)
WindRiver (not added to CMake):
SET (CMAKE_<LANG>_<COMPILER_ID>_DEPFILE_PATTERN <OBJECT_DIR>/<SOURCE_FILE_NAME>.d )
Armcc (RVDS patch exists for CMake):
SET (CMAKE_DEPFILE_FLAGS_C -depend_dir=<OBJECT_FULL_DIR> --depend_format=unix)
SET (CMAKE_C_ARMCC_DEPFILE_PATTERN <OBJECT_FULL_DIR>/<SOURCE_BASE_NAME>.d )
SET (CMAKE_DEPFILE_FLAGS_ASM --depend_format=unix)
SET (CMAKE_ASM_ARMCC_DEPFILE_PATTERN <SOURCE_BASE_NAME>.d )
Note: <OBJECT> is replaced in CMAKE_C_ARMCC_DEPFILE_PATTERN (but adding a semicolon), but not <OBJECT_DIR> (as that is evaluated after FLAGS/DEFINES) so it is a little more than just add new variables.
The workaround for armcc could therefore not use CMAKE_DEPFILE_FLAGS_C, the -depend_dir flag was added to normal FLAGS
</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">———————————————————————————————-</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">I have the same problem with a GHS compiler. We can’t control the name of the generated *.d file while compile step.</pre><div class="">My questions are:</div><div class=""><br class=""></div><div class="">1.) Is ist possible to change the object or/and the dependency file name generated for ninja?</div><div class=""><br class=""></div><div class="">2.) Why generates cmake the objectname as sourcefilename.{c,cpp}.obj?</div><div class=""><br class=""></div><div class="">I would expect to build the name as GNU make do, something like that:</div><div class=""><div style="margin: 0px; line-height: normal; font-family: 'Courier New'; background-color: rgb(255, 147, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">DEP:=$(SRC:.cpp=.d)</b></span></div><div style="margin: 0px; line-height: normal; font-family: 'Courier New'; background-color: rgb(255, 147, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">OBJ:=$(SRC:.cpp=.obj)</b></span></div></div><div class=""><br class="">Claus Klein<br class=""><br class=""><br class=""><br class="">
</div>
<br class=""></body></html>