Browse Source

Use platform variable for response file flag

Create platform variable "CMAKE_<LANG>_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.
Brad King 15 years ago
parent
commit
f9268c9c81
2 changed files with 14 additions and 1 deletions
  1. 2 0
      Source/cmDocumentVariables.cxx
  2. 12 1
      Source/cmMakefileTargetGenerator.cxx

+ 2 - 0
Source/cmDocumentVariables.cxx

@@ -1314,6 +1314,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",

+ 12 - 1
Source/cmMakefileTargetGenerator.cxx

@@ -1620,6 +1620,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)
@@ -1637,7 +1648,7 @@ cmMakefileTargetGenerator
       sep = " ";
 
       // Reference the response file.
-      buildObjs += "@";
+      buildObjs += responseFlag;
       buildObjs += this->Convert(objects_rsp.c_str(),
                                  cmLocalGenerator::NONE,
                                  cmLocalGenerator::SHELL);