Skip to content

Commit 5dec322

Browse files
committed
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
1 parent 763b44e commit 5dec322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/Compiler/TI.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro(__compiler_ti lang)
2929
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
3030
set(CMAKE_${lang}_ARCHIVE_FINISH "")
3131

32-
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>")
32+
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>")
3333
endmacro()
3434

3535
set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")

0 commit comments

Comments
 (0)