Merge branch 'mingw-response-files'

This commit is contained in:
Brad King 2010-06-15 13:58:58 -04:00
commit d9b2da139d
6 changed files with 23 additions and 3 deletions

View File

@ -1,2 +1,3 @@
include(Platform/Windows-GNU)
__windows_compiler_gnu(Fortran)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)

View File

@ -68,6 +68,8 @@ macro(__windows_compiler_gnu lang)
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
# Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE

View File

@ -1324,6 +1324,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_LINK_FLAGS",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES_INIT",

View File

@ -2249,6 +2249,10 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const char* source,
}
result = this->EscapeForShell(result.c_str(), true, false);
}
else if(output == RESPONSE)
{
result = this->EscapeForShell(result.c_str(), false, false);
}
return result;
}

View File

@ -102,7 +102,7 @@ public:
* path setting
*/
enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
enum OutputFormat { UNCHANGED, MAKEFILE, SHELL };
enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
std::string ConvertToOutputFormat(const char* source, OutputFormat output);
std::string Convert(const char* remote, RelativeRoot local,
OutputFormat output = UNCHANGED,

View File

@ -1327,7 +1327,7 @@ public:
this->NextObject =
this->LocalGenerator->Convert(obj.c_str(),
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
cmLocalGenerator::RESPONSE);
// Roll over to next string if the limit will be exceeded.
if(this->LengthLimit != std::string::npos &&
@ -1621,6 +1621,17 @@ cmMakefileTargetGenerator
std::vector<std::string> object_strings;
this->WriteObjectsStrings(object_strings, responseFileLimit);
// Lookup the response file reference flag.
std::string responseFlagVar = "CMAKE_";
responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
const char* responseFlag =
this->Makefile->GetDefinition(responseFlagVar.c_str());
if(!responseFlag)
{
responseFlag = "@";
}
// Write a response file for each string.
const char* sep = "";
for(unsigned int i = 0; i < object_strings.size(); ++i)
@ -1638,7 +1649,7 @@ cmMakefileTargetGenerator
sep = " ";
// Reference the response file.
buildObjs += "@";
buildObjs += responseFlag;
buildObjs += this->Convert(objects_rsp.c_str(),
cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);