On 04.06.2012 23:13, Bill Hoffman wrote:
On 6/4/2012 2:22 PM, Peter Kümmel wrote:
We use ninja's response files:

# Rule for linking CXX static library.
rule CXX_STATIC_LIBRARY_LINKER
    command = E:\sandbox\MinGW32\bin\ar.exe cr $out $LINK_FLAGS @$out.rsp
    description = Linking CXX static library $out
    rspfile = $out.rsp
    rspfile_content = $in

But the problem is, that ar under windows doesn't like paths with one single '\'

and on some UNIXs doesn't support response files at all.
OK, my mistake.  The tool has to support response files.  So, currently
with nmake files we do something like this:

Platform/Windows.cmake:
# for nmake make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
IF(CMAKE_GENERATOR MATCHES "NMake")
    SET(CMAKE_START_TEMP_FILE "@<<\n")
    SET(CMAKE_END_TEMP_FILE "\n<<")
ENDIF(CMAKE_GENERATOR MATCHES "NMake")


Does MinGW32 ar use a different format response file than MS link.exe?
Seems like this should go in the Platform file.  Maybe we don't use it
on UNIX?

-Bill
--

I found the problem: using CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS was wrong.

I've fixed the patch:
1. also write rules with response files enabled
2. then the command line length is checked by cmake and if it
    is too long the rule with the response file is used
3. when MinGW is used the "slashed" pathes are used because ar.exe can't
    read  \ in response files.

The commits are here

http://cmake.org/gitweb?p=stage/cmake.git;a=shortlog;h=refs/heads/ninja-rspfile

and I've merged it into next.

Peter
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to