summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-24 13:40:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-24 13:41:23 (GMT)
commit6b4bb3bf7fe07ef3bea52779824ccc54bf3e622b (patch)
tree881328edfc7a84bf8423e596ab8c386f0a42bbcf /Source
parent2ca901637667ff7ab3eee8546d3f129cb0f492bd (diff)
parent36921d2d231632768bba8dfb33f86fb92e695b43 (diff)
downloadCMake-6b4bb3bf7fe07ef3bea52779824ccc54bf3e622b.zip
CMake-6b4bb3bf7fe07ef3bea52779824ccc54bf3e622b.tar.gz
CMake-6b4bb3bf7fe07ef3bea52779824ccc54bf3e622b.tar.bz2
Merge topic 'xcode-cc-work-dir' into release-3.19
36921d2d23 Xcode: Fix custom command work-dir placeholders in "new build system" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5527
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b40d8ea..7ee94b2 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1965,6 +1965,15 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
return buildPhase;
}
+namespace {
+void ReplaceScriptVars(std::string& cmd)
+{
+ cmSystemTools::ReplaceString(cmd, "$(CONFIGURATION)", "$CONFIGURATION");
+ cmSystemTools::ReplaceString(cmd, "$(EFFECTIVE_PLATFORM_NAME)",
+ "$EFFECTIVE_PLATFORM_NAME");
+}
+}
+
std::string cmGlobalXCodeGenerator::ConstructScript(
cmCustomCommandGenerator const& ccg)
{
@@ -1975,6 +1984,7 @@ std::string cmGlobalXCodeGenerator::ConstructScript(
wd = lg->GetCurrentBinaryDirectory();
}
wd = lg->ConvertToOutputFormat(wd, cmOutputConverter::SHELL);
+ ReplaceScriptVars(wd);
script = cmStrCat(script, " cd ", wd, "\n");
for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
std::string cmd = ccg.GetCommand(c);
@@ -1984,9 +1994,7 @@ std::string cmGlobalXCodeGenerator::ConstructScript(
cmSystemTools::ReplaceString(cmd, "/./", "/");
cmd = lg->ConvertToOutputFormat(cmd, cmOutputConverter::SHELL);
ccg.AppendArguments(c, cmd);
- cmSystemTools::ReplaceString(cmd, "$(CONFIGURATION)", "$CONFIGURATION");
- cmSystemTools::ReplaceString(cmd, "$(EFFECTIVE_PLATFORM_NAME)",
- "$EFFECTIVE_PLATFORM_NAME");
+ ReplaceScriptVars(cmd);
script = cmStrCat(script, " ", cmd, '\n');
}
return script;