Record more policies on targets when created

Policies CMP0027, CMP0038, and CMP0046 have per-target meaning so
record the policy settings on targets as they are created.
This commit is contained in:
Brad King 2014-03-06 09:18:37 -05:00
parent a7c956b867
commit b1bbee3e9a
7 changed files with 13 additions and 7 deletions

View File

@ -349,7 +349,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
cmMakefile *makefile = depender->GetMakefile(); cmMakefile *makefile = depender->GetMakefile();
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false; bool issueMessage = false;
switch(makefile->GetPolicyStatus(cmPolicies::CMP0046)) switch(depender->GetPolicyStatusCMP0046())
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
issueMessage = true; issueMessage = true;

View File

@ -1730,7 +1730,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
cmake::MessageType messageType = cmake::FATAL_ERROR; cmake::MessageType messageType = cmake::FATAL_ERROR;
if (fromEvaluatedImported) if (fromEvaluatedImported)
{ {
switch(mf->GetPolicyStatus(cmPolicies::CMP0027)) switch(tgt->GetPolicyStatusCMP0027())
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
e << (mf->GetPolicies() e << (mf->GetPolicies()
@ -5662,7 +5662,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
bool noMessage = false; bool noMessage = false;
cmake::MessageType messageType = cmake::FATAL_ERROR; cmake::MessageType messageType = cmake::FATAL_ERROR;
cmOStringStream e; cmOStringStream e;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0038)) switch(this->GetPolicyStatusCMP0038())
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {

View File

@ -26,8 +26,11 @@
F(CMP0020) \ F(CMP0020) \
F(CMP0021) \ F(CMP0021) \
F(CMP0022) \ F(CMP0022) \
F(CMP0027) \
F(CMP0038) \
F(CMP0041) \ F(CMP0041) \
F(CMP0042) F(CMP0042) \
F(CMP0046)
class cmake; class cmake;
class cmMakefile; class cmMakefile;

View File

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.4)
project(${RunCMake_TEST} NONE) project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) include(${RunCMake_TEST}.cmake)

View File

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX) project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) include(${RunCMake_TEST}.cmake)

View File

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX) project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) include(${RunCMake_TEST}.cmake)

View File

@ -11,8 +11,11 @@
\* CMP0020 \* CMP0020
\* CMP0021 \* CMP0021
\* CMP0022 \* CMP0022
\* CMP0027
\* CMP0038
\* CMP0041 \* CMP0041
\* CMP0042 \* CMP0042
\* CMP0046
Call Stack \(most recent call first\): Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\) CMakeLists.txt:3 \(include\)