diff options
author | Brad King <brad.king@kitware.com> | 2015-05-12 13:12:56 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-05-12 13:12:56 (GMT) |
commit | 53bb51fc31ddfbc7c62598db1abdef3a1cdd45e7 (patch) | |
tree | c0050bfc45d0254104555d004786dbedfa012751 /Source | |
parent | 70d48e1287c8e91c4815573485c8acba0879df89 (diff) | |
parent | 226df303f955a8756cda7544f58242b52ea7ec2e (diff) | |
download | CMake-53bb51fc31ddfbc7c62598db1abdef3a1cdd45e7.zip CMake-53bb51fc31ddfbc7c62598db1abdef3a1cdd45e7.tar.gz CMake-53bb51fc31ddfbc7c62598db1abdef3a1cdd45e7.tar.bz2 |
Merge topic 'ctest-no-make-i'
226df303 CTest: Stop telling 'make' to ignore errors with -i
28e7a135 Help: Fix build_command alternative signature docs
231601b6 build_command: Choose configuration consistently across signatures
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestBuildCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmBuildCommand.cxx | 8 | ||||
-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, 34 insertions, 4 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 988e9a7..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()); @@ -129,13 +130,14 @@ bool cmBuildCommand std::string configType = "Release"; const char* cfg = getenv("CMAKE_CONFIG_TYPE"); - if ( cfg ) + if ( cfg && *cfg ) { configType = cfg; } 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) |