diff options
author | Brad King <brad.king@kitware.com> | 2018-04-19 12:23:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-19 12:23:08 (GMT) |
commit | 3c6388553aef091556b64daf9bcb6f64fbdcdba2 (patch) | |
tree | 66c10261df25155548db1db3d4568ad29157c80c /Source | |
parent | 6c13ddd6cb0c51afd2789db34b41416b5706336b (diff) | |
parent | a61ae3fb8017a297bd3f3efc447a1f1f29619bdf (diff) | |
download | CMake-3c6388553aef091556b64daf9bcb6f64fbdcdba2.zip CMake-3c6388553aef091556b64daf9bcb6f64fbdcdba2.tar.gz CMake-3c6388553aef091556b64daf9bcb6f64fbdcdba2.tar.bz2 |
Merge topic 'CheckIncludeFile-required-libs'
a61ae3fb80 CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES
391a5837ee cmake_policy: Add undocumented PARENT_SCOPE option to GET
3c47ac5b25 OpenWatcom: Add workaround for lack of error on missing library
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1978
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCMakePolicyCommand.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.h | 3 | ||||
-rw-r--r-- | Source/cmPolicies.h | 5 | ||||
-rw-r--r-- | Source/cmStateSnapshot.cxx | 8 | ||||
-rw-r--r-- | Source/cmStateSnapshot.h | 3 |
7 files changed, 31 insertions, 10 deletions
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index 7ca1cbc..adf9ef8 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -95,7 +95,11 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args) bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args) { - if (args.size() != 3) { + bool parent_scope = false; + if (args.size() == 4 && args[3] == "PARENT_SCOPE") { + // Undocumented PARENT_SCOPE option for use within CMake. + parent_scope = true; + } else if (args.size() != 3) { this->SetError("GET must be given exactly 2 additional arguments."); return false; } @@ -115,7 +119,8 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args) } // Lookup the policy setting. - cmPolicies::PolicyStatus status = this->Makefile->GetPolicyStatus(pid); + cmPolicies::PolicyStatus status = + this->Makefile->GetPolicyStatus(pid, parent_scope); switch (status) { case cmPolicies::OLD: // Report that the policy is set to OLD. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f9eb90f..cf277d5 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1893,6 +1893,13 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/, retVal = 1; } + // The OpenWatcom tools do not return an error code when a link + // library is not found! + if (this->CMakeInstance->GetState()->UseWatcomWMake() && retVal == 0 && + output.find("W1008: cannot open") != std::string::npos) { + retVal = 1; + } + return retVal; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9aeeb5c..490d516 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4089,10 +4089,10 @@ const char* cmMakefile::GetDefineFlagsCMP0059() const return this->DefineFlagsOrig.c_str(); } -cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus( - cmPolicies::PolicyID id) const +cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id, + bool parent_scope) const { - return this->StateSnapshot.GetPolicy(id); + return this->StateSnapshot.GetPolicy(id, parent_scope); } bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d2626cd..8589deb 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -284,7 +284,8 @@ public: */ bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); bool SetPolicy(const char* id, cmPolicies::PolicyStatus status); - cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const; + cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id, + bool parent_scope = false) const; bool SetPolicyVersion(std::string const& version_min, std::string const& version_max); void RecordPolicies(cmPolicies::PolicyMap& pm); diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a21c778..9b9ef60 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -219,7 +219,10 @@ class cmMakefile; "Do not produce legacy _LIB_DEPENDS cache entries.", 3, 12, 0, \ cmPolicies::WARN) \ SELECT(POLICY, CMP0074, "find_package uses PackageName_ROOT variables.", 3, \ - 12, 0, cmPolicies::WARN) + 12, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0075, \ + "Include file check macros honor CMAKE_REQUIRED_LIBRARIES.", 3, 12, \ + 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 0d97c33..0229a77 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -160,8 +160,8 @@ void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id, } } -cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy( - cmPolicies::PolicyID id) const +cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id, + bool parent_scope) const { cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id); @@ -180,6 +180,10 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy( cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator root = dir->DirectoryEnd->PolicyRoot; for (; leaf != root; ++leaf) { + if (parent_scope) { + parent_scope = false; + continue; + } if (leaf->IsDefined(id)) { status = leaf->Get(id); return status; diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 94d6274..af5653b 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -43,7 +43,8 @@ public: cmStateEnums::SnapshotType GetType() const; void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); - cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const; + cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id, + bool parent_scope = false) const; bool HasDefinedPolicyCMP0011(); void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak); bool PopPolicy(); |