mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Compiler/TI: Add compiler flags to linker
By adding the compiler flags via `<FLAGS>` to the linker call, the linker can decide which default library to use. CMake replaces `<FLAGS>` by the content of `CMAKE_<LANG>_FLAGS`. So any relevant flag needs to be defined in this variable, preferably in a toolchain file. The compiler flags have to be specified before the `--run_linker` flag and the linker flags afterwards. Replaces Merge-request !4890
This commit is contained in:
@@ -29,7 +29,7 @@ macro(__compiler_ti lang)
|
||||
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
|
||||
set(CMAKE_${lang}_ARCHIVE_FINISH "")
|
||||
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
|
||||
endmacro()
|
||||
|
||||
set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
|
||||
|
||||
Reference in New Issue
Block a user