[CMake] modify cmake build arguments

fdk17 fdk17 at ftml.net
Fri Aug 30 05:45:07 EDT 2019



>>>> On Thu, 2019-08-29 at 18:27 +0100, hex wrote:
>>>> > hello community,
>>>> > 
>>>> > CMake builds a C project with gcc -o target_name. I have a compiler
>>>> > very similar to GCC and I am trying configure CMake C language for
>>>> > it.
>>>> > 
>>>> > The compiler does not support the -o argument when linking objects. I
>>>> > wonder if there is a way to remove or modify this argument, maybe
>>>> > through one of the properties on targets?
>>>> > 
>>>> > thank you
>>>> 
>>>> Your best bet would be to modify the CMake source code to support your
>>>> compiler. (Upstreaming your changes would be welcome.)
>>>> 
>>>> As a matter of interest, what does it use instead of -o?
>>>> 
>>>> Kyle
>>> 

For linking objects it would be overriding CMAKE_C_LINK_EXECUTABLE:

For example from the TI-C.cmake file:
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190830/ab1eb3ad/attachment.html>


More information about the CMake mailing list