<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Fri, Aug 30, 2019, at 1:47 AM, Eric Doenges wrote:<br></div><blockquote type="cite" id="qt"><div class="qt-moz-cite-prefix">On 29.08.2019 22:38, fdk17 wrote:<br></div><blockquote cite="mid:5ed95f43-eb25-4ac4-86fb-dd72c1a791e4@www.fastmail.com" type="cite"><div>On Thu, Aug 29, 2019, at 2:52 PM, Kyle Edwards via CMake
wrote:<br></div><blockquote id="qt-qt" type="cite"><div>On Thu, 2019-08-29 at 18:27 +0100, hex wrote:<br></div><div>> hello community,<br></div><div>> <br></div><div>> CMake builds a C project with gcc -o target_name. I
have a compiler<br></div><div>> very similar to GCC and I am trying configure CMake C
language for<br></div><div>> it.<br></div><div>> <br></div><div>> The compiler does not support the -o argument when
linking objects. I<br></div><div>> wonder if there is a way to remove or modify this
argument, maybe<br></div><div>> through one of the properties on targets?<br></div><div>> <br></div><div>> thank you<br></div><div><br></div><div>Your best bet would be to modify the CMake source code to
support your<br></div><div>compiler. (Upstreaming your changes would be welcome.)<br></div><div><br></div><div>As a matter of interest, what does it use instead of -o?<br></div><div><br></div><div>Kyle<br></div></blockquote><div><br></div><div>If you are using the Makefile generator then try:<br></div><div><a href="https://cmake.org/cmake/help/latest/variable/CMAKE_USER_MAKE_RULES_OVERRIDE.html">https://cmake.org/cmake/help/latest/variable/CMAKE_USER_MAKE_RULES_OVERRIDE.html</a><br></div><div>You may then be able to provide the rules needed, refer to
"Modules/CMakeCInformation.cmake".<br></div><div>The way I understand it is that the rule templates are used
by the Makefile generator.<br></div><div><br></div></blockquote><p>The way I understand the documentation,
CMAKE_USER_MAKE_RULES_OVERRIDE applies for all generators, not
just the Makefile one. What you are apparently supposed to do is
create a file that sets all the "rule variables" as required (in
this case, CMAKE_C_COMPILE_OBJECT), and then include that file via
CMAKE_USER_MAKE_RULES_OVERRIDE. I'm not sure if these 'rule
variables' are documented anywhere - but you can look into
"<path where CMake is
installed>/share/cmake-<version>/Modules/Compiler" for
inspiration. Another good starting point would be
"<...>/share/cmake-<version>/Modules/CMakeCInformation.cmake".<br></p><p><br></p><div>With kind regards,<br></div><div> Eric<br></div><p><br></p><div class="qt-moz-signature"><div style="width:480px;text-align:left;font-family:Arial, Helvetica, sans-serif;"><p style="text-align: left;"><span style="color:rgb(6, 45, 100)" class="colour"><span style="font-family:Arial, Helvetica, sans-serif" class="font"><span style="font-size:14px" class="size"><b>Dr. Eric Dönges </b><br> Senior Software Engineer</span></span></span></p><p style="text-align: left;"><br></p></div></div></blockquote><div><br></div><div>I could have been clearer about the use of CMAKE_USER_MAKE_RULES_OVERRIDE. It wasn't my intention to suggest that only the Makefile generator makes use of this variable.<br></div><div><br></div><div>In a quick check I only saw the CMAKE_C_COMPILE_OBJECT rule being used by the Makefile (and maybe the Ninja) generator and I know that it isn't used by the GHS Multi generator. Which is why I mentioned the Makefile generator specifically in regards to changing a "-o" to something else.<br></div><div><br></div><div>If you look at Modules/CMakeCInformation.cmake it will only define a rule if it hasn't already been previously set either by the definitions in the compiler / platform files that get included first and then by the override file.<br></div><div><br></div><div>You won't need to define all the rules in the override file just the ones you care to change. Also not all of the rules that get defined applies to all of generators (such as CMAKE_C_COMPILE_OBJECT as already mentioned).<br></div><div><br></div><div>A good example to follow is Modules/Compiler/TI-C.cmake to change a "-o" to something else. From TI-C.cmake:<br></div><div>set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")<br></div><div><br></div><div>Then as suggested the override file could be the basis of a new compiler file that gets submitted upstream.<br></div><div><br></div><div>--<br></div><div>F<br></div></body></html>