summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-13 13:54:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-13 13:54:24 (GMT)
commit18e00ac7b918865c38a2e34ee584e18c1126c663 (patch)
tree7383c63f1bf6f4bce043183a670b1102742acbae /Source/cmMakefile.cxx
parent3b14a4bca417eeafac3daeb306a72dcbba47246e (diff)
parentea5324cd4b570ea757a6da96a7bc85538943e008 (diff)
downloadCMake-18e00ac7b918865c38a2e34ee584e18c1126c663.zip
CMake-18e00ac7b918865c38a2e34ee584e18c1126c663.tar.gz
CMake-18e00ac7b918865c38a2e34ee584e18c1126c663.tar.bz2
Merge topic 'avoid-cmMakefile-IssueMessage-after-configure'
ea5324cd cmMakefile: Port messages for compile features to cmake df8c3130 cmGlobalGenerator: Don't use cmMakefile::IssueMessage after configure 946d1e50 cmMakefile: Avoid IssueMessage after configure is finished 096c7754 cmLocalGenerator: Store Backtrace for the directory
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx52
1 files changed, 38 insertions, 14 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 741a220..c72c95c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -546,7 +546,8 @@ void cmMakefile::EnforceDirectoryLevelRules() const
case cmPolicies::WARN:
// Warn because the user did not provide a mimimum required
// version.
- this->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+ msg.str(), this->Backtrace);
case cmPolicies::OLD:
// OLD behavior is to use policy version 2.4 set in
// cmListFileCache.
@@ -555,7 +556,8 @@ void cmMakefile::EnforceDirectoryLevelRules() const
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
// NEW behavior is to issue an error.
- this->IssueMessage(cmake::FATAL_ERROR, msg.str());
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, msg.str(),
+ this->Backtrace);
cmSystemTools::SetFatalErrorOccured();
return;
}
@@ -651,12 +653,13 @@ void cmMakefile::ConfigureFinalPass()
const char* oldValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
if (oldValue &&
cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, oldValue, "2.4")) {
- this->IssueMessage(
+ this->GetCMakeInstance()->IssueMessage(
cmake::FATAL_ERROR,
"You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less "
"than 2.4. This version of CMake only supports backwards compatibility "
"with CMake 2.4 or later. For compatibility with older versions please "
- "use any CMake 2.8.x release or lower.");
+ "use any CMake 2.8.x release or lower.",
+ this->Backtrace);
}
}
@@ -2048,7 +2051,8 @@ void cmMakefile::ExpandVariablesCMP0019()
<< "The following variable evaluations were encountered:\n"
<< w.str();
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, m.str());
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, m.str(),
+ this->Backtrace);
}
}
@@ -4002,14 +4006,20 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
<< this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
<< "\"\nversion "
<< this->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (error) {
+ *error = e.str();
+ } else {
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
+ }
return false;
}
target->AppendProperty("COMPILE_FEATURES", feature.c_str());
- return lang == "C" ? this->AddRequiredTargetCFeature(target, feature)
- : this->AddRequiredTargetCxxFeature(target, feature);
+ return lang == "C"
+ ? this->AddRequiredTargetCFeature(target, feature, error)
+ : this->AddRequiredTargetCxxFeature(target, feature, error);
}
bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
@@ -4045,7 +4055,8 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
if (error) {
*error = e.str();
} else {
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
}
return false;
}
@@ -4070,7 +4081,8 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
if (error) {
*error = e.str();
} else {
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
}
return 0;
}
@@ -4257,7 +4269,8 @@ void cmMakefile::CheckNeededCxxLanguage(const std::string& feature,
}
bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
- const std::string& feature) const
+ const std::string& feature,
+ std::string* error) const
{
bool needCxx98 = false;
bool needCxx11 = false;
@@ -4273,7 +4286,12 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
std::ostringstream e;
e << "The CXX_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCxxStandard << "\".";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (error) {
+ *error = e.str();
+ } else {
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
+ }
return false;
}
}
@@ -4338,7 +4356,8 @@ void cmMakefile::CheckNeededCLanguage(const std::string& feature,
}
bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
- const std::string& feature) const
+ const std::string& feature,
+ std::string* error) const
{
bool needC90 = false;
bool needC99 = false;
@@ -4353,7 +4372,12 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
std::ostringstream e;
e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\".";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (error) {
+ *error = e.str();
+ } else {
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
+ }
return false;
}
}