summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-08-06 14:59:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-08-06 15:00:12 (GMT)
commit4daf76e10ab3f53b1be15626f0901916dd10885c (patch)
treecc782076c25301f574f1982488ec05fab7f92dc2 /Source
parentfdcb7483d11030fe597208843437ad6cce71ff50 (diff)
parentf76c20da6395c0830ac0de667c105b0b29f84c7a (diff)
downloadCMake-4daf76e10ab3f53b1be15626f0901916dd10885c.zip
CMake-4daf76e10ab3f53b1be15626f0901916dd10885c.tar.gz
CMake-4daf76e10ab3f53b1be15626f0901916dd10885c.tar.bz2
Merge topic 'compiler_flags'
f76c20da63 Toolchain: Test compiler initial settings db486da265 Toolchain: Update documentation for initial compiler flags deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER 12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn' 6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER ec1d3bc0b6 cmake: avoid exception when printing "changed variables" message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4136
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx8
-rw-r--r--Source/cmRulePlaceholderExpander.cxx2
-rw-r--r--Source/cmake.cxx9
3 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 530bb59..cad5d1f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -235,6 +235,14 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang,
}
cmProp cname =
this->GetCMakeInstance()->GetState()->GetInitializedCacheValue(langComp);
+
+ // Split compiler from arguments
+ std::vector<std::string> cnameArgVec;
+ if (cname && !cname->empty()) {
+ cmExpandList(*cname, cnameArgVec);
+ cname = &cnameArgVec.front();
+ }
+
std::string changeVars;
if (cname && !optional) {
std::string cnameString;
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index 254131b..4ff81c1 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -261,7 +261,7 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
this->VariableMappings["CMAKE_" + compIt->second +
"_COMPILE_OPTIONS_SYSROOT"];
- // if there is a required first argument to the compiler add it
+ // if there are required arguments to the compiler add it
// to the compiler string
if (!compilerArg1.empty()) {
ret += " ";
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1e688ed..dcb96f8 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1390,8 +1390,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
save.key = *i;
warning << *i << "= ";
i++;
- save.value = *i;
- warning << *i << "\n";
+ if (i != argsSplit.end()) {
+ save.value = *i;
+ warning << *i << "\n";
+ } else {
+ warning << "\n";
+ i -= 1;
+ }
cmProp existingValue = this->State->GetCacheEntryValue(save.key);
if (existingValue) {
save.type = this->State->GetCacheEntryType(save.key);