diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst index 3d86a2e032..21adab9473 100644 --- a/Help/command/build_command.rst +++ b/Help/command/build_command.rst @@ -15,14 +15,14 @@ This is mainly intended for internal use by the :module:`CTest` module. Sets the given ```` to a command-line string of the form:: - --build . [--config ] [--parallel ] [--target ...] [-- -i] + --build . [--config ] [--parallel ] [--target ...] where ```` is the location of the :manual:`cmake(1)` command-line tool, and ````, ```` and ```` are the values provided to the ``CONFIGURATION``, ``PARALLEL_LEVEL`` and ``TARGET`` -options, if any. The trailing ``-- -i`` option is added for -:ref:`Makefile Generators` if policy :policy:`CMP0061` is not set to -``NEW``. +options, if any. In CMake versions prior to 4.0, a trailing ``-- -i`` +option was added for :ref:`Makefile Generators` if policy :policy:`CMP0061` +was not set to ``NEW``. When invoked, this :option:`cmake --build` command line will launch the underlying build system tool. diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst index 22ec0d0b78..765ecb7786 100644 --- a/Help/policy/CMP0061.rst +++ b/Help/policy/CMP0061.rst @@ -1,6 +1,9 @@ CMP0061 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + .. versionadded:: 3.3 CTest does not by default tell ``make`` to ignore errors (``-i``). @@ -22,7 +25,5 @@ calls in CTest. The ``NEW`` behavior for this policy is to not add ``-i``. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3 -.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn +.. include:: REMOVED_EPILOGUE.txt diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index b57c9030e7..c85188c8d6 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -93,7 +93,7 @@ std::unique_ptr cmCTestBuildCommand::InitializeHandler( std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory"); std::string buildCommand = globalGenerator->GenerateCMakeBuildCommand( cmakeBuildTarget, cmakeBuildConfiguration, args.ParallelLevel, - cmakeBuildAdditionalFlags, mf.IgnoreErrorsCMP0061()); + cmakeBuildAdditionalFlags, false); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "SetMakeCommand:" << buildCommand << "\n", args.Quiet); diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 415a124472..75595b8b11 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -84,7 +84,7 @@ bool MainSignature(std::vector const& args, } std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand( - target, configuration, parallel, "", mf.IgnoreErrorsCMP0061()); + target, configuration, parallel, "", false); mf.AddDefinition(variable, makecommand); @@ -111,7 +111,7 @@ bool TwoArgsSignature(std::vector const& args, } std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand( - "", configType, "", "", mf.IgnoreErrorsCMP0061()); + "", configType, "", "", false); if (cacheValue) { return true; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 630777933f..4a019abddf 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4101,22 +4101,6 @@ void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm) const } } -bool cmMakefile::IgnoreErrorsCMP0061() const -{ - bool ignoreErrors = true; - switch (this->GetPolicyStatus(cmPolicies::CMP0061)) { - case cmPolicies::WARN: - // No warning for this policy! - CM_FALLTHROUGH; - case cmPolicies::OLD: - break; - case cmPolicies::NEW: - ignoreErrors = false; - break; - } - return ignoreErrors; -} - cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf, const std::string& fileName, cmPolicies::PolicyMap const& pm) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 74f988e8a1..ba2f2edfe4 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -417,8 +417,6 @@ public: cmMakefile* Makefile; }; - bool IgnoreErrorsCMP0061() const; - std::string const& GetHomeDirectory() const; std::string const& GetHomeOutputDirectory() const; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index db658cb26d..f234d1582f 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -180,7 +180,7 @@ class cmMakefile; 0, NEW) \ SELECT(POLICY, CMP0061, \ "CTest does not by default tell make to ignore errors (-i).", 3, 3, \ - 0, WARN) \ + 0, NEW) \ SELECT(POLICY, CMP0062, "Disallow install() of export() result.", 3, 3, 0, \ WARN) \ SELECT(POLICY, CMP0063, \ diff --git a/Tests/RunCMake/build_command/CMP0061-NEW.cmake b/Tests/RunCMake/build_command/CMP0061-NEW.cmake index 2e439cbbd3..e0b3bebf0d 100644 --- a/Tests/RunCMake/build_command/CMP0061-NEW.cmake +++ b/Tests/RunCMake/build_command/CMP0061-NEW.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0061 NEW) include(CMP0061Common.cmake) diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt b/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt deleted file mode 100644 index 1938da37fd..0000000000 --- a/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt +++ /dev/null @@ -1,21 +0,0 @@ -^CMake Deprecation Warning at CMP0061-OLD-make.cmake:[0-9]+ \(cmake_policy\): - The OLD behavior for policy CMP0061 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -+ -[^ -]+ --build \. --config "Release" -- -i -[^ -]+ --build \. --config "Release" --target "MyTarget" -- -i -[^ -]+ --build \. --config "Debug" -- -i -[^ -]+ --build \. --config "Debug" --target "MyTarget" -- -i -[^ -]+ --build \. --config "Release" -- -i$ diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake b/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake deleted file mode 100644 index 1542d8c16b..0000000000 --- a/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0061 OLD) -include(CMP0061Common.cmake) diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt b/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt deleted file mode 100644 index 85bbdf1751..0000000000 --- a/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt +++ /dev/null @@ -1,21 +0,0 @@ -^CMake Deprecation Warning at CMP0061-OLD-other.cmake:[0-9]+ \(cmake_policy\): - The OLD behavior for policy CMP0061 will be removed from a future version - of CMake. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -+ -[^ -]+ --build \. --config "Release" -[^ -]+ --build \. --config "Release" --target "MyTarget" -[^ -]+ --build \. --config "Debug" -[^ -]+ --build \. --config "Debug" --target "MyTarget" -[^ -]+ --build \. --config "Release"$ diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake b/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake deleted file mode 100644 index 1542d8c16b..0000000000 --- a/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_policy(SET CMP0061 OLD) -include(CMP0061Common.cmake) diff --git a/Tests/RunCMake/build_command/RunCMakeTest.cmake b/Tests/RunCMake/build_command/RunCMakeTest.cmake index 030db0b5c2..0e05bd9711 100644 --- a/Tests/RunCMake/build_command/RunCMakeTest.cmake +++ b/Tests/RunCMake/build_command/RunCMakeTest.cmake @@ -9,10 +9,5 @@ run_cmake(BeforeProject) unset(RunCMake_TEST_OPTIONS) run_cmake(CMP0061-NEW) -if(RunCMake_GENERATOR MATCHES "Make") - run_cmake(CMP0061-OLD-make) -else() - run_cmake(CMP0061-OLD-other) -endif() run_cmake(ParallelLevel) diff --git a/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-result.txt b/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-result.txt deleted file mode 100644 index 9cdf4a5ad1..0000000000 --- a/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -(0|-1|255) diff --git a/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-stderr.txt b/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-stderr.txt deleted file mode 100644 index 18710a30ba..0000000000 --- a/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -^CMake Deprecation Warning at [^ -]*/Tests/RunCMake/ctest_build/BuildFailure-CMP0061-OLD/test\.cmake:[0-9]+ \(cmake_policy\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\. -+(Error\(s\) when building project -)?ctest_build returned zero$ diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake index af56ead3eb..f45a972351 100644 --- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake @@ -33,17 +33,6 @@ else() endif() ]]) run_ctest(BuildFailure) - - if (RunCMake_GENERATOR MATCHES "Makefiles") - set(LANG NONE) - set(CASE_TEST_PREFIX_CODE [[ -cmake_policy(VERSION 3.2) -]]) - set(CASE_CMAKELISTS_SUFFIX_CODE [[ -add_custom_target(BuildFailure ALL COMMAND command-does-not-exist) -]]) - run_ctest(BuildFailure-CMP0061-OLD) - endif() endblock() function(run_BuildChangeId)