summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx3
-rw-r--r--Source/cmBuildCommand.cxx6
-rw-r--r--Source/cmBuildCommand.h2
-rw-r--r--Source/cmMakefile.cxx20
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmPolicies.h3
6 files changed, 33 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 2b36b0a..27e22c4 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -141,7 +141,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
= this->GlobalGenerator->
GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
cmakeBuildConfiguration,
- cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
+ cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "",
+ this->Makefile->IgnoreErrorsCMP0061());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n", this->Quiet);
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str(),
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 27b959c..62fafa5 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -106,7 +106,8 @@ bool cmBuildCommand
}
std::string makecommand = this->Makefile->GetGlobalGenerator()
- ->GenerateCMakeBuildCommand(target, configuration, "", true);
+ ->GenerateCMakeBuildCommand(target, configuration, "",
+ this->Makefile->IgnoreErrorsCMP0061());
this->Makefile->AddDefinition(variable, makecommand.c_str());
@@ -135,7 +136,8 @@ bool cmBuildCommand
}
std::string makecommand = this->Makefile->GetGlobalGenerator()
- ->GenerateCMakeBuildCommand("", configType, "", true);
+ ->GenerateCMakeBuildCommand("", configType, "",
+ this->Makefile->IgnoreErrorsCMP0061());
if(cacheValue)
{
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index 3fb618f..979abc0 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -53,6 +53,8 @@ public:
virtual std::string GetName() const {return "build_command";}
cmTypeMacro(cmBuildCommand, cmCommand);
+private:
+ bool IgnoreErrors() const;
};
#endif
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 82add86..4ded936 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4942,6 +4942,26 @@ void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm)
}
}
+//----------------------------------------------------------------------------
+bool cmMakefile::IgnoreErrorsCMP0061() const
+{
+ bool ignoreErrors = true;
+ switch (this->GetPolicyStatus(cmPolicies::CMP0061))
+ {
+ case cmPolicies::WARN:
+ // No warning for this policy!
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ ignoreErrors = false;
+ break;
+ }
+ return ignoreErrors;
+}
+
+//----------------------------------------------------------------------------
#define FEATURE_STRING(F) , #F
static const char * const C_FEATURES[] = {
0
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 99f2544..e0eef6f 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -415,6 +415,8 @@ public:
bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const;
+ bool IgnoreErrorsCMP0061() const;
+
const char* GetHomeDirectory() const;
const char* GetHomeOutputDirectory() const;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 63376dd..536dcdc 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -208,6 +208,9 @@ class cmPolicy;
3, 3, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0060, \
"Link libraries by full path even in implicit directories.", \
+ 3, 3, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0061, \
+ "CTest does not by default tell make to ignore errors (-i).", \
3, 3, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)