I found this conversation: CMAKE_C_LINK_EXECUTABLE not considered for MINGW32
Looks like their suggestion there is to make a custom platform ID where I can populate the CMAKE_C_LINK_EXECUTABLE
/CMAKE_CXX_LINK_EXECUTABLE
which ever way I want. This makes me wonder if this is a deficiency in the implementation of Modules/Compiler/TI-CXX.cmake
. Should it be checking if it’s defined before it set()
's the variable? e.g.
if(NOT DEFINED CMAKE_C_LINK_EXECUTABLE)
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")
endif()