Commit b1bbee3e authored by Brad King's avatar Brad King
Browse files

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.
parent a7c956b8
......@@ -349,7 +349,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
cmMakefile *makefile = depender->GetMakefile();
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false;
switch(makefile->GetPolicyStatus(cmPolicies::CMP0046))
switch(depender->GetPolicyStatusCMP0046())
{
case cmPolicies::WARN:
issueMessage = true;
......
......@@ -1730,7 +1730,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
cmake::MessageType messageType = cmake::FATAL_ERROR;
if (fromEvaluatedImported)
{
switch(mf->GetPolicyStatus(cmPolicies::CMP0027))
switch(tgt->GetPolicyStatusCMP0027())
{
case cmPolicies::WARN:
e << (mf->GetPolicies()
......@@ -5662,7 +5662,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
bool noMessage = false;
cmake::MessageType messageType = cmake::FATAL_ERROR;
cmOStringStream e;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0038))
switch(this->GetPolicyStatusCMP0038())
{
case cmPolicies::WARN:
{
......
......@@ -26,8 +26,11 @@
F(CMP0020) \
F(CMP0021) \
F(CMP0022) \
F(CMP0027) \
F(CMP0038) \
F(CMP0041) \
F(CMP0042)
F(CMP0042) \
F(CMP0046)
class cmake;
class cmMakefile;
......
cmake_minimum_required(VERSION 2.8.4)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
include(${RunCMake_TEST}.cmake)
cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
include(${RunCMake_TEST}.cmake)
cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
include(${RunCMake_TEST}.cmake)
......@@ -11,8 +11,11 @@
\* CMP0020
\* CMP0021
\* CMP0022
\* CMP0027
\* CMP0038
\* CMP0041
\* CMP0042
\* CMP0046
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment