diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 22 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 12 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 15 | ||||
-rw-r--r-- | Source/cmMakefile.h | 11 | ||||
-rw-r--r-- | Source/cmPolicies.h | 5 |
7 files changed, 48 insertions, 23 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 559b00d..1ea4df3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 23) -set(CMake_VERSION_PATCH 20220328) +set(CMake_VERSION_PATCH 20220330) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 67214f1..e156e3d 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -803,7 +803,9 @@ bool cmComputeLinkInformation::AddLibraryFeature(std::string const& feature) cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_LIBRARY_USING_", feature); cmValue featureSupported = this->Makefile->GetDefinition(cmStrCat(featureName, "_SUPPORTED")); - if (!featureSupported.IsOn()) { + if (!featureSupported) { + // language specific variable is not defined, fallback to the more generic + // one featureName = cmStrCat("CMAKE_LINK_LIBRARY_USING_", feature); featureSupported = this->Makefile->GetDefinition(cmStrCat(featureName, "_SUPPORTED")); @@ -965,7 +967,9 @@ cmComputeLinkInformation::GetGroupFeature(std::string const& feature) cmStrCat("CMAKE_", this->LinkLanguage, "_LINK_GROUP_USING_", feature); cmValue featureSupported = this->Makefile->GetDefinition(cmStrCat(featureName, "_SUPPORTED")); - if (!featureSupported.IsOn()) { + if (!featureSupported) { + // language specific variable is not defined, fallback to the more generic + // one featureName = cmStrCat("CMAKE_LINK_GROUP_USING_", feature); featureSupported = this->Makefile->GetDefinition(cmStrCat(featureName, "_SUPPORTED")); @@ -1551,8 +1555,7 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) this->AddLibraryFeature("FRAMEWORK"); } - if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s) && - target->IsFrameworkOnApple() && !this->GlobalGenerator->IsXcode()) { + if (target->IsFrameworkOnApple() && !this->GlobalGenerator->IsXcode()) { // Add the framework directory and the framework item itself auto fwItems = this->GlobalGenerator->SplitFrameworkPath(item.Value, true); if (!fwItems) { @@ -1567,8 +1570,15 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) // Add the directory portion to the framework search path. this->AddFrameworkPath(fwItems->first); } - this->Items.emplace_back(fwItems->second, ItemIsPath::Yes, target, - this->FindLibraryFeature(entry.Feature)); + if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) { + this->Items.emplace_back(fwItems->second, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature)); + } else { + this->Items.emplace_back( + item, ItemIsPath::Yes, target, + this->FindLibraryFeature( + entry.Feature == DEFAULT ? "__CMAKE_LINK_LIBRARY" : entry.Feature)); + } } else { // Now add the full path to the library. this->Items.emplace_back( diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index b869308..3c31db1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -759,7 +759,9 @@ void cmGlobalGenerator::EnableLanguage( needTestLanguage[lang] = true; // Some generators like visual studio should not use the env variables // So the global generator can specify that in this variable - if (!mf->GetDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV")) { + if ((mf->GetPolicyStatus(cmPolicies::CMP0132) == cmPolicies::OLD || + mf->GetPolicyStatus(cmPolicies::CMP0132) == cmPolicies::WARN) && + !mf->GetDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV")) { // put ${CMake_(LANG)_COMPILER_ENV_VAR}=${CMAKE_(LANG)_COMPILER // into the environment, in case user scripts want to run // configure, or sub cmakes diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 55f6453..9cd1943 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -73,11 +73,11 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, } // watch for our state change if (scopeDepth == 0 && func.LowerCaseName() == "else") { + cmListFileBacktrace elseBT = mf.GetBacktrace().Push( + cmListFileContext{ func.OriginalName(), + this->GetStartingContext().FilePath, func.Line() }); if (this->ElseSeen) { - cmListFileBacktrace elseBT = mf.GetBacktrace().Push(cmListFileContext{ - func.OriginalName(), this->GetStartingContext().FilePath, - func.Line() }); mf.GetCMakeInstance()->IssueMessage( MessageType::FATAL_ERROR, "A duplicate ELSE command was found inside an IF block.", elseBT); @@ -92,7 +92,8 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, // if trace is enabled, print a (trivially) evaluated "else" // statement if (!this->IsBlocking && mf.GetCMakeInstance()->GetTrace()) { - mf.PrintCommandTrace(func); + mf.PrintCommandTrace(func, elseBT, + cmMakefile::CommandMissingFromStack::Yes); } } else if (scopeDepth == 0 && func.LowerCaseName() == "elseif") { cmListFileBacktrace elseifBT = mf.GetBacktrace().Push( @@ -111,7 +112,8 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, } else { // if trace is enabled, print the evaluated "elseif" statement if (mf.GetCMakeInstance()->GetTrace()) { - mf.PrintCommandTrace(func); + mf.PrintCommandTrace(func, elseifBT, + cmMakefile::CommandMissingFromStack::Yes); } std::string errorString; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f0a96a8..a781d59 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -241,14 +241,14 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const return this->Backtrace; } -void cmMakefile::PrintCommandTrace( - cmListFileFunction const& lff, - cm::optional<std::string> const& deferId) const +void cmMakefile::PrintCommandTrace(cmListFileFunction const& lff, + cmListFileBacktrace const& bt, + CommandMissingFromStack missing) const { // Check if current file in the list of requested to trace... std::vector<std::string> const& trace_only_this_files = this->GetCMakeInstance()->GetTraceSources(); - std::string const& full_path = this->GetBacktrace().Top().FilePath; + std::string const& full_path = bt.Top().FilePath; std::string const& only_filename = cmSystemTools::GetFilenameName(full_path); bool trace = trace_only_this_files.empty(); if (!trace) { @@ -282,6 +282,7 @@ void cmMakefile::PrintCommandTrace( args.push_back(arg.Value); } } + cm::optional<std::string> const& deferId = bt.Top().DeferId; switch (this->GetCMakeInstance()->GetTraceFormat()) { case cmake::TraceFormat::TRACE_JSON_V1: { @@ -303,9 +304,9 @@ void cmMakefile::PrintCommandTrace( val["args"].append(arg); } val["time"] = cmSystemTools::GetTime(); - val["frame"] = + val["frame"] = (missing == CommandMissingFromStack::Yes ? 1 : 0) + static_cast<Json::Value::UInt64>(this->ExecutionStatusStack.size()); - val["global_frame"] = + val["global_frame"] = (missing == CommandMissingFromStack::Yes ? 1 : 0) + static_cast<Json::Value::UInt64>(this->RecursionDepth); msg << Json::writeString(builder, val); #endif @@ -427,7 +428,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, if (!cmSystemTools::GetFatalErrorOccured()) { // if trace is enabled, print out invoke information if (this->GetCMakeInstance()->GetTrace()) { - this->PrintCommandTrace(lff, this->Backtrace.Top().DeferId); + this->PrintCommandTrace(lff, this->Backtrace); } // Try invoking the command. bool invokeSucceeded = command(lff.Arguments(), status); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 6d44e79..c8e1e83 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -674,11 +674,18 @@ public: bool copyonly, bool atOnly, bool escapeQuotes, mode_t permissions = 0, cmNewLineStyle = cmNewLineStyle()); + enum class CommandMissingFromStack + { + No, + Yes, + }; + /** * Print a command's invocation */ - void PrintCommandTrace(cmListFileFunction const& lff, - cm::optional<std::string> const& deferId = {}) const; + void PrintCommandTrace( + cmListFileFunction const& lff, cmListFileBacktrace const& bt, + CommandMissingFromStack missing = CommandMissingFromStack::No) const; /** * Set a callback that is invoked whenever ExecuteCommand is called. diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 3b9d067..434c51c 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -393,7 +393,10 @@ class cmMakefile; 3, 24, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0131, \ "LINK_LIBRARIES supports the LINK_ONLY generator expression.", 3, \ - 24, 0, cmPolicies::WARN) + 24, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0132, \ + "Do not set compiler environment variables on first run", 3, 24, 0, \ + cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ |