From f9268c9c818dbf4aec3d7a8d6dd8fbea7da96021 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 11 Mar 2010 09:03:26 -0500 Subject: [PATCH] Use platform variable for response file flag Create platform variable "CMAKE__RESPONSE_FILE_LINK_FLAG" to specify an alternative to "@" for referencing response files. It applies specifically to response files with linker options. See issue #10401. --- Source/cmDocumentVariables.cxx | 2 ++ Source/cmMakefileTargetGenerator.cxx | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index c6f9ba5f7f..695733452c 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1314,6 +1314,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE__LINK_FLAGS", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE__RESPONSE_FILE_LINK_FLAG", + cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE__STANDARD_LIBRARIES", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE__STANDARD_LIBRARIES_INIT", diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index e35e5a31d4..eae7101a77 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1620,6 +1620,17 @@ cmMakefileTargetGenerator std::vector 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) @@ -1637,7 +1648,7 @@ cmMakefileTargetGenerator sep = " "; // Reference the response file. - buildObjs += "@"; + buildObjs += responseFlag; buildObjs += this->Convert(objects_rsp.c_str(), cmLocalGenerator::NONE, cmLocalGenerator::SHELL);