diff options
author | Brad King <brad.king@kitware.com> | 2015-05-08 19:41:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-12 13:06:49 (GMT) |
commit | 226df303f955a8756cda7544f58242b52ea7ec2e (patch) | |
tree | f4ad45a19cb1b2387b93f76355f06d19c8b9dbfd /Source | |
parent | 28e7a135e001afb36a7cff8e896ebac75390dde0 (diff) | |
download | CMake-226df303f955a8756cda7544f58242b52ea7ec2e.zip CMake-226df303f955a8756cda7544f58242b52ea7ec2e.tar.gz CMake-226df303f955a8756cda7544f58242b52ea7ec2e.tar.bz2 |
CTest: Stop telling 'make' to ignore errors with -i
Add policy CMP0061 to maintain compatibility for existing projects.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestBuildCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmBuildCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmBuildCommand.h | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 20 | ||||
-rw-r--r-- | Source/cmMakefile.h | 2 | ||||
-rw-r--r-- | Source/cmPolicies.h | 3 |
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) |