diff options
author | Brad King <brad.king@kitware.com> | 2020-11-24 13:40:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-24 13:41:24 (GMT) |
commit | 2bca5fa6aa07e95b5436b5139e0a2ef04f153ebd (patch) | |
tree | 32a9bc3ac75722e37df125d6d3b946ed20bee04f /Source/cmGlobalXCodeGenerator.cxx | |
parent | e7a06f93c281ed74a8001291165a879a34db7e89 (diff) | |
parent | 36921d2d231632768bba8dfb33f86fb92e695b43 (diff) | |
download | CMake-2bca5fa6aa07e95b5436b5139e0a2ef04f153ebd.zip CMake-2bca5fa6aa07e95b5436b5139e0a2ef04f153ebd.tar.gz CMake-2bca5fa6aa07e95b5436b5139e0a2ef04f153ebd.tar.bz2 |
Merge topic 'xcode-cc-work-dir'
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/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0d41b98..a881b74 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1964,6 +1964,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) { @@ -1974,6 +1983,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); @@ -1983,9 +1993,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; |