1
0
Эх сурвалжийг харах

CMP0047: Remove support for OLD behavior

Brad King 11 сар өмнө
parent
commit
05b2c563bb

+ 6 - 5
Help/policy/CMP0047.rst

@@ -1,6 +1,9 @@
 CMP0047
 CMP0047
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Use ``QCC`` compiler id for the qcc drivers on QNX.
 Use ``QCC`` compiler id for the qcc drivers on QNX.
 
 
 CMake 3.0 and above recognize that the QNX qcc compiler driver is
 CMake 3.0 and above recognize that the QNX qcc compiler driver is
@@ -20,11 +23,9 @@ for the qcc and QCC compiler drivers. The ``NEW`` behavior for this policy
 is to use the ``QCC`` compiler id for those drivers.
 is to use the ``QCC`` compiler id for those drivers.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
-.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
+.. include:: REMOVED_EPILOGUE.txt
 
 
 See documentation of the
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 :variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
-variable to control the warning.
-
-.. include:: DEPRECATED.txt
+variable to control the warning in CMake versions before 4.0.

+ 2 - 2
Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst

@@ -8,8 +8,8 @@ only for the policies that do not warn by default:
 
 
 * ``CMAKE_POLICY_WARNING_CMP0025`` controlled the warning for
 * ``CMAKE_POLICY_WARNING_CMP0025`` controlled the warning for
   policy :policy:`CMP0025` in CMake versions before 4.0.
   policy :policy:`CMP0025` in CMake versions before 4.0.
-* ``CMAKE_POLICY_WARNING_CMP0047`` controls the warning for
-  policy :policy:`CMP0047`.
+* ``CMAKE_POLICY_WARNING_CMP0047`` controlled the warning for
+  policy :policy:`CMP0047` in CMake versions before 4.0.
 * ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for
 * ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for
   policy :policy:`CMP0056`.
   policy :policy:`CMP0056`.
 * ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
 * ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for

+ 0 - 30
Source/cmGlobalGenerator.cxx

@@ -1010,36 +1010,6 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
   std::string compilerIdVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID");
   std::string compilerIdVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID");
   std::string const compilerId = mf->GetSafeDefinition(compilerIdVar);
   std::string const compilerId = mf->GetSafeDefinition(compilerIdVar);
 
 
-  if (compilerId == "QCC") {
-    switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) {
-      case cmPolicies::WARN:
-        if (!this->CMakeInstance->GetIsInTryCompile() &&
-            mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) {
-          std::ostringstream w;
-          /* clang-format off */
-          w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0047) << "\n"
-            "Converting " << lang <<
-            R"( compiler id "QCC" to "GNU" for compatibility.)"
-            ;
-          /* clang-format on */
-          mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
-        }
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        // OLD behavior is to convert QCC to GNU.
-        mf->AddDefinition(compilerIdVar, "GNU");
-        if (lang == "C") {
-          mf->AddDefinition("CMAKE_COMPILER_IS_GNUCC", "1");
-        } else if (lang == "CXX") {
-          mf->AddDefinition("CMAKE_COMPILER_IS_GNUCXX", "1");
-        }
-        break;
-      case cmPolicies::NEW:
-        // NEW behavior is to keep QCC.
-        break;
-    }
-  }
-
   if (compilerId == "XLClang") {
   if (compilerId == "XLClang") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) {
       case cmPolicies::WARN:
       case cmPolicies::WARN:

+ 1 - 1
Source/cmPolicies.h

@@ -143,7 +143,7 @@ class cmMakefile;
          "Error on non-existent dependency in add_dependencies.", 3, 0, 0,    \
          "Error on non-existent dependency in add_dependencies.", 3, 0, 0,    \
          NEW)                                                                 \
          NEW)                                                                 \
   SELECT(POLICY, CMP0047, "Use QCC compiler id for the qcc drivers on QNX.",  \
   SELECT(POLICY, CMP0047, "Use QCC compiler id for the qcc drivers on QNX.",  \
-         3, 0, 0, WARN)                                                       \
+         3, 0, 0, NEW)                                                        \
   SELECT(POLICY, CMP0048, "project() command manages VERSION variables.", 3,  \
   SELECT(POLICY, CMP0048, "project() command manages VERSION variables.", 3,  \
          0, 0, WARN)                                                          \
          0, 0, WARN)                                                          \
   SELECT(POLICY, CMP0049,                                                     \
   SELECT(POLICY, CMP0049,                                                     \