Hello,
We are using cmake and ti-cgt-arm compiler to set up a build environment for a project. The linker or archiver options will be very long because there are so many object files to be linked or archived. And this would exceed command line limitation of system and cause link or archive failure. Cmake can handle this issue by using response file like this,
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS TRUE)
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS TRUE)
So if using TI compiler, cmake will do the following operation,
default command line generated by cmake is like this,
armar.exe qr library.a <objects>
armcl.exe --run_linker --output_file=name.out --map_file=name.map <objects>
after using response file, command line will be like this
armar.exe qr library.a --cmd_file=object.rsp
armcl.exe --run_linker --output_file=name.out --map_file=name.map --cmd_file=object.rsp
The problem is --cmd_file option can NOT work in above commands. As a result, --cmd_file is basically useless because only the object or library will have a very long characters and need to put it into a file.
Below is the cmake snippet for TI CGT ARM compiler from cmake install directory
set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_FINISH "")
# After the --run_linker flag a response file is not possible
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "") # if TI compiler support, it should be "--cmd_file="
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0)
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>")