[CMake] How can I disable response file used by cmake ?
Dongsheng Song
dongsheng.song at gmail.com
Thu Jan 27 04:48:23 EST 2011
Hi,
In Windows-GNU.make:
# Support very long lists of object files.
if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@")
foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE)
# The gcc/collect2/ld toolchain does not use response files
# internally so we cannot pass long object lists. Instead pass
# the object file list in a response file to the archiver to put
# them in a temporary archive. Hand the archive to the linker.
string(REPLACE "<OBJECTS>" "-Wl,--whole-archive <OBJECT_DIR>/objects.a
-Wl,--no-whole-archive"
CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}")
set(CMAKE_${lang}_${rule}
"<CMAKE_COMMAND> -E remove -f <OBJECT_DIR>/objects.a"
"<CMAKE_AR> cr <OBJECT_DIR>/objects.a <OBJECTS>"
"${CMAKE_${lang}_${rule}}"
)
endforeach()
endif()
So if I use GCC generate .DLL with .DEF, not worked as expected. If I drop
the code block, .DEF file will be worked as expected.
How can I disable response file in CMakeLists.txt ?
PS: If someone can check if there have .DEF file in "<OBJECTS>", then append
it to the final "${CMAKE_${lang}_${rule}}", it should be fine too.
--
Dongsheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110127/82546d4d/attachment.htm>
More information about the CMake
mailing list