Merge topic 'remove-old-compatibility'

77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
This commit is contained in:
Brad King
2025-01-23 14:36:34 +00:00
committed by Kitware Robot
213 changed files with 172 additions and 1612 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
.. versionchanged:: 4.0
Compatibility with versions of CMake older than 3.1 is removed.
Compatibility with versions of CMake older than 3.5 is removed.
Calls to :command:`cmake_minimum_required(VERSION)` or
:command:`cmake_policy(VERSION)` that do not specify at least
3.1 as their policy version (optionally via ``...<max>``)
3.5 as their policy version (optionally via ``...<max>``)
will produce an error in CMake 4.0 and above.
.. versionchanged:: 3.31
+4 -4
View File
@@ -15,14 +15,14 @@ This is mainly intended for internal use by the :module:`CTest` module.
Sets the given ``<variable>`` to a command-line string of the form::
<cmake> --build . [--config <config>] [--parallel <parallel>] [--target <target>...] [-- -i]
<cmake> --build . [--config <config>] [--parallel <parallel>] [--target <target>...]
where ``<cmake>`` is the location of the :manual:`cmake(1)` command-line
tool, and ``<config>``, ``<parallel>`` and ``<target>`` 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.
+2 -1
View File
@@ -59,7 +59,8 @@ Each ``<item>`` may be:
There are some cases where CMake may ask the linker to search for
the library (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such
as when a shared library is detected to have no ``SONAME`` field.
See policy :policy:`CMP0060` for discussion of another case.
In CMake versions prior to 4.0, see policy :policy:`CMP0060` for
discussion of another case.
If the library file is in a macOS framework, the ``Headers`` directory
of the framework will also be processed as a
+3 -4
View File
@@ -320,15 +320,14 @@ Other Behavior Settings
* :variable:`CMAKE_CUDA_RUNTIME_LIBRARY`
* :variable:`CMAKE_ENABLE_EXPORTS`
* :variable:`CMAKE_EXE_LINKER_FLAGS`, unless using CMake versions
prior to 4.0 without policy :policy:`CMP0056` set to ``NEW``
* :variable:`CMAKE_LINK_SEARCH_START_STATIC`
* :variable:`CMAKE_LINK_SEARCH_END_STATIC`
* :variable:`CMAKE_MSVC_RUNTIME_LIBRARY`
* :variable:`CMAKE_POSITION_INDEPENDENT_CODE`
* :variable:`CMAKE_WATCOM_RUNTIME_LIBRARY`
If :policy:`CMP0056` is set to ``NEW``, then
:variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
.. versionchanged:: 3.14
If :policy:`CMP0083` is set to ``NEW``, then in order to obtain correct
behavior at link time, the ``check_pie_supported()`` command from the
@@ -338,7 +337,7 @@ Other Behavior Settings
Some policies are set automatically in the generated test project
as needed to honor the state of the calling project:
* :policy:`CMP0065`
* :policy:`CMP0065` (in CMake versions prior to 4.0)
* :policy:`CMP0083`
* :policy:`CMP0091`
* :policy:`CMP0104`
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0055
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.2
Strict checking for the :command:`break` command.
@@ -14,7 +17,5 @@ outside of loop contexts and ignores any arguments. The ``NEW`` behavior for th
policy is to issue an error if a misplaced break or any arguments are found.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+6 -5
View File
@@ -1,6 +1,9 @@
CMP0056
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.2
Honor link flags in :command:`try_compile` source-file signature.
@@ -28,11 +31,9 @@ set it on the command line by defining the
variable in the cache.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
.. |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
:variable:`CMAKE_POLICY_WARNING_CMP0056 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
.. include:: DEPRECATED.txt
variable to control the warning in CMake versions before 4.0.
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0057
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Support new :command:`if` IN_LIST operator.
@@ -11,7 +14,5 @@ The ``OLD`` behavior for this policy is to ignore the IN_LIST operator.
The ``NEW`` behavior is to interpret the IN_LIST operator.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+7 -6
View File
@@ -1,6 +1,9 @@
CMP0058
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Ninja requires custom command byproducts to be explicit.
@@ -104,12 +107,10 @@ rules for unknown dependencies in the build tree. The ``NEW``
behavior for this policy is to not generate these and instead
require projects to specify custom command ``BYPRODUCTS`` explicitly.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNS_OR_DOES_NOT_WARN| replace::
warns when it sees unknown dependencies in out-of-source build trees
.. include:: STANDARD_ADVICE.txt
The policy setting must be in scope at the end of the top-level
``CMakeLists.txt`` file of the project and has global effect.
.. include:: DEPRECATED.txt
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNED_OR_DID_NOT_WARN| replace::
warned when it saw unknown dependencies in out-of-source build trees
.. include:: REMOVED_EPILOGUE.txt
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0059
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Do not treat ``DEFINITIONS`` as a built-in directory property.
@@ -14,7 +17,5 @@ so far to the :command:`add_definitions` command. The ``NEW`` behavior is
to behave as a normal user-defined directory property.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+6 -5
View File
@@ -1,6 +1,9 @@
CMP0060
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Link libraries by full path even in implicit directories.
@@ -59,11 +62,9 @@ The ``NEW`` behavior for this policy is to link libraries by full path even
if they are in implicit link directories.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |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
:variable:`CMAKE_POLICY_WARNING_CMP0060 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
.. include:: DEPRECATED.txt
variable to control the warning in CMake versions before 4.0.
+5 -4
View File
@@ -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
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0062
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Disallow :command:`install` of :command:`export` result.
@@ -24,7 +27,5 @@ an :command:`export()` command. The ``NEW`` behavior for this policy is
not to allow installing the result of an :command:`export()` command.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0063
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.3
Honor visibility properties for all target types.
@@ -23,7 +26,5 @@ The ``NEW`` behavior for this policy is to honor the visibility properties
for all target types.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+5 -4
View File
@@ -1,6 +1,9 @@
CMP0064
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.4
Recognize ``TEST`` as a operator for the :command:`if` command.
@@ -12,7 +15,5 @@ The ``OLD`` behavior for this policy is to ignore the ``TEST`` operator.
The ``NEW`` behavior is to interpret the ``TEST`` operator.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt
+6 -5
View File
@@ -1,6 +1,9 @@
CMP0065
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
.. versionadded:: 3.4
Do not add flags to export symbols from executables without
@@ -21,11 +24,9 @@ flags when linking executables if the :prop_tgt:`ENABLE_EXPORTS` target
property is set to ``True``.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
.. |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
:variable:`CMAKE_POLICY_WARNING_CMP0065 <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
View File
@@ -5,8 +5,8 @@ Value for symbol visibility compile flags
The ``<LANG>_VISIBILITY_PRESET`` property determines the value passed in a
visibility related compile option, such as ``-fvisibility=`` for ``<LANG>``.
This property affects compilation in sources of all types of targets
(subject to policy :policy:`CMP0063`).
This property affects compilation in sources of all types of targets.
See policy :policy:`CMP0063`.
This property is initialized by the value of the
:variable:`CMAKE_<LANG>_VISIBILITY_PRESET` variable if it is set when a
+1 -1
View File
@@ -6,7 +6,7 @@ Whether to add a compile flag to hide symbols of inline functions
The ``VISIBILITY_INLINES_HIDDEN`` property determines whether a flag for
hiding symbols for inline functions, such as ``-fvisibility-inlines-hidden``,
should be used when invoking the compiler. This property affects compilation
in sources of all types of targets (subject to policy :policy:`CMP0063`).
in sources of all types of targets. See policy :policy:`CMP0063`.
This property is initialized by
the value of the :variable:`CMAKE_VISIBILITY_INLINES_HIDDEN` variable if it
@@ -1,7 +1,7 @@
remove-old-compatibility
------------------------
* Compatibility with versions of CMake older than 3.1 has been removed.
* Compatibility with versions of CMake older than 3.5 has been removed.
Calls to :command:`cmake_minimum_required` or :command:`cmake_policy`
that set the policy version to an older value now issue an error.
Note that calls to those commands can still support older versions of
@@ -31,9 +31,9 @@ Some toolchains read implicit directories from an environment variable such as
consistent when operating in a given build tree because CMake saves the value
detected when first creating a build tree.
If policy :policy:`CMP0060` is not set to ``NEW``, then when a library in one
of these directories is given by full path to :command:`target_link_libraries`
CMake will generate the ``-l<name>`` form on link lines for historical
purposes.
In CMake versions prior to 4.0, if policy :policy:`CMP0060` is not set
to ``NEW``, then when a library in one of these directories is given by
full path to :command:`target_link_libraries` CMake will generate the
``-l<name>`` form on link lines for historical purposes.
See also the :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES` variable.
@@ -10,12 +10,12 @@ only for the policies that do not warn by default:
policy :policy:`CMP0025` in CMake versions before 4.0.
* ``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
policy :policy:`CMP0056`.
* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
policy :policy:`CMP0060`.
* ``CMAKE_POLICY_WARNING_CMP0065`` controls the warning for
policy :policy:`CMP0065`.
* ``CMAKE_POLICY_WARNING_CMP0056`` controlled the warning for
policy :policy:`CMP0056` in CMake versions before 4.0.
* ``CMAKE_POLICY_WARNING_CMP0060`` controlled the warning for
policy :policy:`CMP0060` in CMake versions before 4.0.
* ``CMAKE_POLICY_WARNING_CMP0065`` controlled the warning for
policy :policy:`CMP0065` in CMake versions before 4.0.
* ``CMAKE_POLICY_WARNING_CMP0066`` controls the warning for
policy :policy:`CMP0066`.
* ``CMAKE_POLICY_WARNING_CMP0067`` controls the warning for
-5
View File
@@ -247,9 +247,6 @@ if(DEFINED CMAKE_GENERATOR)
endif()
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# The functions defined in this file depend on the get_prerequisites function
# (and possibly others) found in:
#
@@ -1127,5 +1124,3 @@ function(verify_app app)
message(FATAL_ERROR "error: verify_app failed")
endif()
endfunction()
cmake_policy(POP)
-5
View File
@@ -20,9 +20,6 @@
# on UNIX, cygwin and mingw
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# Resolve full path of CMAKE_TOOL from user-defined name and SEARCH_PATH.
function(__resolve_tool_path CMAKE_TOOL SEARCH_PATH DOCSTRING)
@@ -274,5 +271,3 @@ if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^xIAR$")
set(CMAKE_IAR_LINKER "${CMAKE_LINKER}" CACHE FILEPATH "The IAR ILINK linker")
mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)
endif()
cmake_policy(POP)
-5
View File
@@ -1,9 +1,6 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# Function to print messages of this module
function(_ios_install_combined_message)
message(STATUS "[iOS combined] " ${ARGN})
@@ -319,5 +316,3 @@ function(ios_install_combined target destination)
_ios_install_combined_message("Install done: ${destination}")
endfunction()
cmake_policy(POP)
-5
View File
@@ -186,9 +186,6 @@ Helper functions which are used by the above ones
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
function(csharp_get_filename_keys OUT)
set(${OUT} "")
foreach(f ${ARGN})
@@ -309,5 +306,3 @@ function(csharp_set_xaml_cs_properties)
endif()
endforeach()
endfunction()
cmake_policy(POP)
-5
View File
@@ -12,9 +12,6 @@ set(_ARMClang_CMAKE_LOADED TRUE)
# Save the CMP0123 setting in a variable used both below and by try_compile.
cmake_policy(GET CMP0123 CMAKE_ARMClang_CMP0123)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
if (CMAKE_LINKER MATCHES "armlink")
@@ -142,5 +139,3 @@ macro(__compiler_armclang lang)
set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
endmacro()
cmake_policy(POP)
-5
View File
@@ -7,9 +7,6 @@ set(__cmake_craype_crayprgenv 1)
# CrayPrgEnv: loaded when compiling through the Cray compiler wrapper.
# The compiler wrapper can run on a front-end node or a compute node.
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# One-time setup of the craype environment. First, check the wrapper config.
# The wrapper's selection of a compiler (gcc, clang, intel, etc.) and
# default include/library paths is selected using the "module" command.
@@ -132,5 +129,3 @@ macro(__CrayPrgEnv_setup lang)
endif()
endmacro()
cmake_policy(POP)
-5
View File
@@ -16,9 +16,6 @@ endif()
# Whenever needed, override this default behavior using CMAKE_IAR_CXX_FLAG in your toolchain file.
if(NOT CMAKE_IAR_CXX_FLAG)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
set(_CMAKE_IAR_MODERNCXX_LIST 14 17)
if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST _CMAKE_IAR_MODERNCXX_LIST OR
("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" AND ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} EQUAL 98))
@@ -27,8 +24,6 @@ if(NOT CMAKE_IAR_CXX_FLAG)
set(CMAKE_IAR_CXX_FLAG --eec++)
endif()
unset(_CMAKE_IAR_MODERNCXX_LIST)
cmake_policy(POP)
endif()
set(CMAKE_CXX_STANDARD_COMPILE_OPTION "")
-5
View File
@@ -1300,9 +1300,6 @@ The custom step could then be triggered from the main build like so::
include(${CMAKE_CURRENT_LIST_DIR}/ExternalProject/shared_internal_commands.cmake)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED)
define_property(DIRECTORY PROPERTY "EP_PREFIX" INHERITED)
define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED)
@@ -3088,5 +3085,3 @@ function(ExternalProject_Add name)
#
_ep_add_test_command(${name})
endfunction()
cmake_policy(POP)
-1
View File
@@ -400,7 +400,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var)
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
-5
View File
@@ -400,9 +400,6 @@ Deprecated Hint Variables
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# For backwards compatibility support
if(Doxygen_FIND_QUIETLY)
set(DOXYGEN_FIND_QUIETLY TRUE)
@@ -1215,5 +1212,3 @@ doxygen_add_docs() for target ${targetName}")
endif()
endfunction()
cmake_policy(POP)
-3
View File
@@ -481,15 +481,12 @@ function(_HDF5_select_imported_config target imported_conf)
message(STATUS "Start search through imported configurations in the following order: ${_preferred_confs}")
endif()
# Now find the first of these that is present in imported_conf
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # support IN_LISTS
foreach (_conf IN LISTS _preferred_confs)
if (${_conf} IN_LIST _imported_conf)
set(_imported_conf ${_conf})
break()
endif()
endforeach()
cmake_policy(POP)
endif()
if(HDF5_FIND_DEBUG)
message(STATUS "Selected imported configuration: ${_imported_conf}")
-5
View File
@@ -98,9 +98,6 @@ The following cache variables are also available to set or use:
The include path to ``jawt.h``.
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)
include(CheckSourceCompiles)
include(CMakePushCheckState)
include(FindPackageHandleStandardArgs)
@@ -692,5 +689,3 @@ if(JNI_FOUND)
unset(_JNI_JVM_TYPE)
endif()
endif()
cmake_policy(POP)
-1
View File
@@ -264,7 +264,6 @@ Additionally, the following variables are deprecated:
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-1
View File
@@ -299,7 +299,6 @@ Reference
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}")
-1
View File
@@ -111,7 +111,6 @@ to know what include directories are needed.
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
function(_OPENMP_FLAG_CANDIDATES LANG)
@@ -214,11 +214,6 @@ Example for the usage:
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
cmake_policy(PUSH)
# IN_LIST operator
cmake_policy(SET CMP0057 NEW)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
set(__msg "${_msg}")
@@ -602,6 +597,3 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
endfunction()
cmake_policy(POP)
-5
View File
@@ -33,9 +33,6 @@ for how these variables are initialized.
#]========================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
### Common stuff ####
set(PKG_CONFIG_VERSION 1)
@@ -1046,5 +1043,3 @@ Variables Affecting Behavior
### Local Variables:
### mode: cmake
### End:
cmake_policy(POP)
-1
View File
@@ -92,7 +92,6 @@ is set regardless of the presence of the ``Server`` component in find_package ca
# ----------------------------------------------------------------------------
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
-2
View File
@@ -10,8 +10,6 @@
#
cmake_policy(PUSH)
# IN_LIST operator
cmake_policy (SET CMP0057 NEW)
# foreach loop variable scope
cmake_policy (SET CMP0124 NEW)
# registry view behavior
-1
View File
@@ -66,7 +66,6 @@ The following cache variables may also be set:
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(_TIFF_args)
-1
View File
@@ -220,7 +220,6 @@ environment.
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
# Provide compatibility with a common invalid component request that
-5
View File
@@ -188,9 +188,6 @@ macro(DBG_MSG_V _MSG)
# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
endmacro()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# Clear return values in case the module is loaded more than once.
set(wxWidgets_FOUND FALSE)
set(wxWidgets_INCLUDE_DIRS "")
@@ -1241,5 +1238,3 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
endfunction()
cmake_policy(POP)
+1 -6
View File
@@ -348,12 +348,7 @@ function(FortranCInterface_VERIFY)
set(_FortranCInterface_OSX_ARCH "")
endif()
cmake_policy(GET CMP0056 _FortranCInterface_CMP0056)
if(_FortranCInterface_CMP0056 STREQUAL "NEW")
set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}")
else()
set(_FortranCInterface_EXE_LINKER_FLAGS "")
endif()
set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}")
# Build a sample project which reports symbols.
set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
+1 -7
View File
@@ -36,13 +36,7 @@ else()
set(_FortranCInterface_OSX_ARCH "")
endif()
cmake_policy(GET CMP0056 _FortranCInterface_CMP0056)
if(_FortranCInterface_CMP0056 STREQUAL "NEW")
set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}")
else()
set(_FortranCInterface_EXE_LINKER_FLAGS "")
endif()
unset(_FortranCInterface_CMP0056)
set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}")
# Build a sample project which reports symbols.
set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
-5
View File
@@ -174,9 +174,6 @@ Possible types are:
other
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
function(gp_append_unique list_var value)
if(NOT value IN_LIST ${list_var})
set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE)
@@ -1046,5 +1043,3 @@ function(list_prerequisites_by_glob glob_arg glob_exp)
endif()
endforeach()
endfunction()
cmake_policy(POP)
-5
View File
@@ -10,9 +10,6 @@ if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
function(cpack_deb_variable_fallback OUTPUT_VAR_NAME)
set(FALLBACK_VAR_NAMES ${ARGN})
@@ -886,5 +883,3 @@ function(cpack_deb_prepare_package_vars)
endfunction()
cpack_deb_prepare_package_vars()
cmake_policy(POP)
-5
View File
@@ -3,9 +3,6 @@
# Author: Eric Noulard with the help of Alexander Neundorf.
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
function(set_spec_script_if_enabled TYPE PACKAGE_NAME VAR)
if(NOT "${VAR}" STREQUAL "" AND NOT "${VAR}" STREQUAL "\n")
if(PACKAGE_NAME)
@@ -1999,5 +1996,3 @@ mv %_topdir/tmpBBroot $RPM_BUILD_ROOT
endfunction()
cpack_rpm_generate_package()
cmake_policy(POP)
@@ -3,9 +3,6 @@
include_guard(GLOBAL)
block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
if(NOT DEFINED "${_var}")
set(_lang_filename "src")
@@ -138,5 +135,3 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
endif()
endif()
endfunction()
endblock()
-5
View File
@@ -3,9 +3,6 @@
include_guard(GLOBAL)
block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
if(NOT DEFINED "${_var}")
@@ -130,5 +127,3 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
endif()
endif()
endfunction()
endblock()
+1 -1
View File
@@ -12,7 +12,7 @@ macro(__aix_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
+1 -1
View File
@@ -12,7 +12,7 @@ macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
-1
View File
@@ -31,7 +31,6 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
# If using Android tools for Visual Studio, compile a sample project to get the
-2
View File
@@ -394,8 +394,6 @@ Deprecated Commands
#]=======================================================================]
cmake_policy(PUSH)
# IN_LIST operator
cmake_policy (SET CMP0057 NEW)
# Ninja generator normalizes custom command depfile paths
cmake_policy (SET CMP0116 NEW)
+1 -1
View File
@@ -93,7 +93,7 @@ std::unique_ptr<cmCTestGenericHandler> 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);
+1 -1
View File
@@ -364,7 +364,7 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/CMake")
endif()
install(CODE "
include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS ON)
fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${Qt_BIN_DIR};${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
" ${COMPONENT})
+9 -48
View File
@@ -2,68 +2,29 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBreakCommand.h"
#include <sstream>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
// cmBreakCommand
bool cmBreakCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
if (!status.GetMakefile().IsLoopBlock()) {
bool issueMessage = true;
std::ostringstream e;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
break;
case cmPolicies::OLD:
issueMessage = false;
break;
case cmPolicies::NEW:
messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "A BREAK command was found outside of a proper "
"FOREACH or WHILE loop scope.";
status.GetMakefile().IssueMessage(messageType, e.str());
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"A BREAK command was found outside of a proper "
"FOREACH or WHILE loop scope.");
return false;
}
status.SetBreakInvoked();
if (!args.empty()) {
bool issueMessage = true;
std::ostringstream e;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
break;
case cmPolicies::OLD:
issueMessage = false;
break;
case cmPolicies::NEW:
messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "The BREAK command does not accept any arguments.";
status.GetMakefile().IssueMessage(messageType, e.str());
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR,
"The BREAK command does not accept any arguments.");
return false;
}
return true;
+2 -2
View File
@@ -84,7 +84,7 @@ bool MainSignature(std::vector<std::string> 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<std::string> const& args,
}
std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand(
"", configType, "", "", mf.IgnoreErrorsCMP0061());
"", configType, "", "", false);
if (cacheValue) {
return true;
+1 -53
View File
@@ -24,7 +24,6 @@
#include "cmMessageType.h"
#include "cmOrderDirectories.h"
#include "cmPlaceholderExpander.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmStateTypes.h"
@@ -421,9 +420,6 @@ cmComputeLinkInformation::cmComputeLinkInformation(
this->OrderDependentRPath->SetImplicitDirectories(this->ImplicitLinkDirs);
this->OrderDependentRPath->AddLanguageDirectories(this->RuntimeLinkDirs);
}
this->CMP0060Warn = this->Makefile->PolicyOptionalWarningEnabled(
"CMAKE_POLICY_WARNING_CMP0060");
}
cmComputeLinkInformation::~cmComputeLinkInformation() = default;
@@ -650,22 +646,6 @@ bool cmComputeLinkInformation::Compute()
// Add implicit language runtime libraries and directories.
this->AddImplicitLinkInfo();
if (!this->CMP0060WarnItems.empty()) {
std::ostringstream w;
/* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0060) << "\n"
"Some library files are in directories implicitly searched by "
"the linker when invoked for " << this->LinkLanguage << ":\n"
" " << cmJoin(this->CMP0060WarnItems, "\n ") << "\n"
"For compatibility with older versions of CMake, the generated "
"link line will ask the linker to search for these by library "
"name."
;
/* clang-format on */
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
// Record targets referenced by $<TARGET_OBJECTS:...> sources.
this->AddExternalObjectTargets();
@@ -1765,39 +1745,7 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(LinkEntry const& entry)
return false;
}
// Check the policy for whether we should use the approach below.
switch (this->Target->GetPolicyStatusCMP0060()) {
case cmPolicies::WARN:
if (this->CMP0060Warn) {
// Print the warning at most once for this item.
std::string const& wid =
cmStrCat("CMP0060-WARNING-GIVEN-", item.Value);
if (!this->CMakeInstance->GetPropertyAsBool(wid)) {
this->CMakeInstance->SetProperty(wid, "1");
this->CMP0060WarnItems.insert(item.Value);
}
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
break;
case cmPolicies::NEW:
return false;
}
// Many system linkers support multiple architectures by
// automatically selecting the implicit linker search path for the
// current architecture. If the library appears in an implicit link
// directory then just report the file name without the directory
// portion. This will allow the system linker to locate the proper
// library for the architecture at link time.
LinkEntry fileEntry{ entry };
fileEntry.Item = file;
this->AddUserItem(fileEntry);
// Make sure the link directory ordering will find the library.
this->OrderLinkerSearchPath->AddLinkLibrary(item.Value);
return true;
return false;
}
void cmComputeLinkInformation::AddUserItem(LinkEntry const& entry)
-2
View File
@@ -239,7 +239,6 @@ private:
// Additional paths configured by the runtime linker
std::vector<std::string> RuntimeLinkDirs;
std::set<std::string> CMP0060WarnItems;
// Dependent library path computation.
std::unique_ptr<cmOrderDirectories> OrderDependentRPath;
// Runtime path computation.
@@ -252,7 +251,6 @@ private:
bool LinkWithRuntimePath;
bool LinkTypeEnabled;
bool ArchivesMayBeShared;
bool CMP0060Warn;
void AddLibraryRuntimeInfo(std::string const& fullPath,
const cmGeneratorTarget* target);
+5 -48
View File
@@ -218,8 +218,6 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
cmListFileBacktrace bt)
: Makefile(makefile)
, Backtrace(std::move(bt))
, Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057))
, Policy64Status(makefile.GetPolicyStatus(cmPolicies::CMP0064))
, Policy139Status(makefile.GetPolicyStatus(cmPolicies::CMP0139))
{
}
@@ -427,26 +425,6 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
{
for (auto args = newArgs.make2ArgsIterator(); args.current != newArgs.end();
args.advance(newArgs)) {
auto policyCheck = [&, this](const cmPolicies::PolicyID id,
const cmPolicies::PolicyStatus status,
const cm::static_string_view kw) {
if (status == cmPolicies::WARN && this->IsKeyword(kw, *args.current)) {
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(id) << "\n"
<< kw
<< " will be interpreted as an operator "
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
};
// NOTE Checking policies for warnings are not require an access to the
// next arg. Check them first!
policyCheck(cmPolicies::CMP0064, this->Policy64Status, keyTEST);
// NOTE Fail fast: All the predicates below require the next arg to be
// valid
if (args.next == newArgs.end()) {
@@ -534,10 +512,6 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
}
// does a test exist
else if (this->IsKeyword(keyTEST, *args.current)) {
if (this->Policy64Status == cmPolicies::OLD ||
this->Policy64Status == cmPolicies::WARN) {
continue;
}
newArgs.ReduceOneArg(
static_cast<bool>(this->Makefile.GetTest(args.next->GetValue())),
args);
@@ -665,29 +639,12 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
}
else if (this->IsKeyword(keyIN_LIST, *args.next)) {
cmValue lhs = this->GetVariableOrString(*args.current);
cmValue rhs = this->Makefile.GetDefinition(args.nextnext->GetValue());
if (this->Policy57Status != cmPolicies::OLD &&
this->Policy57Status != cmPolicies::WARN) {
cmValue lhs = this->GetVariableOrString(*args.current);
cmValue rhs = this->Makefile.GetDefinition(args.nextnext->GetValue());
newArgs.ReduceTwoArgs(
rhs &&
cm::contains(cmList{ *rhs, cmList::EmptyElements::Yes }, *lhs),
args);
}
else if (this->Policy57Status == cmPolicies::WARN) {
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0057)
<< "\n"
"IN_LIST will be interpreted as an operator "
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
newArgs.ReduceTwoArgs(
rhs && cm::contains(cmList{ *rhs, cmList::EmptyElements::Yes }, *lhs),
args);
}
else if (this->IsKeyword(keyPATH_EQUAL, *args.next)) {
-2
View File
@@ -66,7 +66,5 @@ private:
cmMakefile& Makefile;
cmListFileBacktrace Backtrace;
cmPolicies::PolicyStatus Policy57Status;
cmPolicies::PolicyStatus Policy64Status;
cmPolicies::PolicyStatus Policy139Status;
};
+8 -37
View File
@@ -786,36 +786,14 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
}
} break;
}
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0056)) {
case cmPolicies::WARN:
if (this->Makefile->PolicyOptionalWarningEnabled(
"CMAKE_POLICY_WARNING_CMP0056")) {
std::ostringstream w;
/* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0056) << "\n"
"For compatibility with older versions of CMake, try_compile "
"is not honoring caller link flags (e.g. CMAKE_EXE_LINKER_FLAGS) "
"in the test project."
;
/* clang-format on */
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to do nothing.
break;
case cmPolicies::NEW:
// NEW behavior is to pass linker flags.
{
cmValue exeLinkFlags =
this->Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS %s)\n",
cmOutputConverter::EscapeForCMake(*exeLinkFlags).c_str());
if (exeLinkFlags) {
cmakeVariables.emplace("CMAKE_EXE_LINKER_FLAGS", *exeLinkFlags);
}
}
break;
{
cmValue exeLinkFlags =
this->Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS %s)\n",
cmOutputConverter::EscapeForCMake(*exeLinkFlags).c_str());
if (exeLinkFlags) {
cmakeVariables.emplace("CMAKE_EXE_LINKER_FLAGS", *exeLinkFlags);
}
}
fprintf(fout,
"set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}"
@@ -869,13 +847,6 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
fprintf(fout, "\n");
}
/* Set the appropriate policy information for ENABLE_EXPORTS */
fprintf(fout, "cmake_policy(SET CMP0065 %s)\n",
this->Makefile->GetPolicyStatus(cmPolicies::CMP0065) ==
cmPolicies::NEW
? "NEW"
: "OLD");
/* Set the appropriate policy information for PIE link flags */
fprintf(fout, "cmake_policy(SET CMP0083 %s)\n",
this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) ==
-24
View File
@@ -5,14 +5,10 @@
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
#include "cmValue.h"
namespace {
void StoreResult(cmMakefile& makefile, std::string const& variable,
const char* prop);
void StoreResult(cmMakefile& makefile, std::string const& variable,
cmValue prop);
}
@@ -78,31 +74,11 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args,
return false;
}
if (*i == "DEFINITIONS") {
switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0059)) {
case cmPolicies::WARN:
status.GetMakefile().IssueMessage(
MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
CM_FALLTHROUGH;
case cmPolicies::OLD:
StoreResult(status.GetMakefile(), variable,
status.GetMakefile().GetDefineFlagsCMP0059());
return true;
case cmPolicies::NEW:
break;
}
}
StoreResult(status.GetMakefile(), variable, dir->GetProperty(*i));
return true;
}
namespace {
void StoreResult(cmMakefile& makefile, std::string const& variable,
const char* prop)
{
makefile.AddDefinition(variable, prop ? prop : "");
}
void StoreResult(cmMakefile& makefile, std::string const& variable,
cmValue prop)
{
-15
View File
@@ -12,7 +12,6 @@
#include "cmGlobalGenerator.h"
#include "cmInstalledFile.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmPropertyDefinition.h"
@@ -370,20 +369,6 @@ bool HandleDirectoryMode(cmExecutionStatus& status, const std::string& name,
}
}
if (propertyName == "DEFINITIONS") {
switch (mf->GetPolicyStatus(cmPolicies::CMP0059)) {
case cmPolicies::WARN:
mf->IssueMessage(MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
CM_FALLTHROUGH;
case cmPolicies::OLD:
return StoreResult(infoType, status.GetMakefile(), variable,
mf->GetDefineFlagsCMP0059());
case cmPolicies::NEW:
break;
}
}
// Get the property.
return StoreResult(infoType, status.GetMakefile(), variable,
mf->GetProperty(propertyName));
-149
View File
@@ -30,7 +30,6 @@
#include "cmDyndepCollation.h"
#include "cmFortranParser.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLinkLineComputer.h"
@@ -243,9 +242,6 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
// Write explicit outputs
for (std::string const& output : build.Outputs) {
buildStr = cmStrCat(buildStr, ' ', this->EncodePath(output));
if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(output);
}
}
// Write implicit outputs
if (!build.ImplicitOuts.empty()) {
@@ -254,9 +250,6 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
buildStr = cmStrCat(buildStr, " |");
for (std::string const& implicitOut : build.ImplicitOuts) {
buildStr = cmStrCat(buildStr, ' ', this->EncodePath(implicitOut));
if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(implicitOut);
}
}
}
@@ -371,14 +364,6 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
{
this->AddCustomCommandRule();
if (this->ComputingUnknownDependencies) {
// we need to track every dependency that comes in, since we are trying
// to find dependencies that are side effects of build commands
for (std::string const& dep : explicitDeps) {
this->CombinedCustomCommandExplicitDependencies.insert(dep);
}
}
{
std::string ninjaDepfilePath;
bool depfileIsOutput = false;
@@ -641,19 +626,11 @@ void cmGlobalNinjaGenerator::Generate()
this->ClangTidyExportFixesDirs.clear();
this->ClangTidyExportFixesFiles.clear();
this->PolicyCMP0058 =
this->LocalGenerators[0]->GetMakefile()->GetPolicyStatus(
cmPolicies::CMP0058);
this->ComputingUnknownDependencies =
(this->PolicyCMP0058 == cmPolicies::OLD ||
this->PolicyCMP0058 == cmPolicies::WARN);
this->cmGlobalGenerator::Generate();
this->WriteAssumedSourceDependencies();
this->WriteTargetAliases(*this->GetCommonFileStream());
this->WriteFolderTargets(*this->GetCommonFileStream());
this->WriteUnknownExplicitDependencies(*this->GetCommonFileStream());
this->WriteBuiltinTargets(*this->GetCommonFileStream());
if (cmSystemTools::GetErrorOccurredFlag()) {
@@ -1227,10 +1204,6 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
if (!this->CompileCommandsStream) {
std::string buildFilePath =
cmStrCat(buildFileDir, "/compile_commands.json");
if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(
this->NinjaOutputPath("compile_commands.json"));
}
// Get a stream where to generate things.
this->CompileCommandsStream =
@@ -1779,128 +1752,6 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
}
void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
{
if (!this->ComputingUnknownDependencies) {
return;
}
// We need to collect the set of known build outputs.
// Start with those generated by WriteBuild calls.
// No other method needs this so we can take ownership
// of the set locally and throw it out when we are done.
std::set<std::string> knownDependencies;
knownDependencies.swap(this->CombinedBuildOutputs);
// now write out the unknown explicit dependencies.
// union the configured files, evaluations files and the
// CombinedBuildOutputs,
// and then difference with CombinedExplicitDependencies to find the explicit
// dependencies that we have no rule for
cmGlobalNinjaGenerator::WriteDivider(os);
/* clang-format off */
os << "# Unknown Build Time Dependencies.\n"
<< "# Tell Ninja that they may appear as side effects of build rules\n"
<< "# otherwise ordered by order-only dependencies.\n\n";
/* clang-format on */
// get the list of files that cmake itself has generated as a
// product of configuration.
for (const auto& lg : this->LocalGenerators) {
// get the vector of files created by this makefile and convert them
// to ninja paths, which are all relative in respect to the build directory
for (std::string const& file : lg->GetMakefile()->GetOutputFiles()) {
knownDependencies.insert(this->ConvertToNinjaPath(file));
}
if (!this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION")) {
// get list files which are implicit dependencies as well and will be
// phony for rebuild manifest
for (std::string const& j : lg->GetMakefile()->GetListFiles()) {
knownDependencies.insert(this->ConvertToNinjaPath(j));
}
}
for (const auto& li : lg->GetMakefile()->GetEvaluationFiles()) {
// get all the files created by generator expressions and convert them
// to ninja paths
for (std::string const& evaluationFile : li->GetFiles()) {
knownDependencies.insert(this->ConvertToNinjaPath(evaluationFile));
}
}
}
knownDependencies.insert(this->CMakeCacheFile);
for (auto const& ta : this->TargetAliases) {
knownDependencies.insert(this->ConvertToNinjaPath(ta.first));
}
// remove all source files we know will exist.
for (auto const& i : this->AssumedSourceDependencies) {
knownDependencies.insert(this->ConvertToNinjaPath(i.first));
}
// now we difference with CombinedCustomCommandExplicitDependencies to find
// the list of items we know nothing about.
// We have encoded all the paths in CombinedCustomCommandExplicitDependencies
// and knownDependencies so no matter if unix or windows paths they
// should all match now.
std::vector<std::string> unknownExplicitDepends;
this->CombinedCustomCommandExplicitDependencies.erase(this->TargetAll);
std::set_difference(this->CombinedCustomCommandExplicitDependencies.begin(),
this->CombinedCustomCommandExplicitDependencies.end(),
knownDependencies.begin(), knownDependencies.end(),
std::back_inserter(unknownExplicitDepends));
std::vector<std::string> warnExplicitDepends;
if (!unknownExplicitDepends.empty()) {
cmake* cmk = this->GetCMakeInstance();
std::string const& buildRoot = cmk->GetHomeOutputDirectory();
bool const inSource = (buildRoot == cmk->GetHomeDirectory());
bool const warn = (!inSource && (this->PolicyCMP0058 == cmPolicies::WARN));
cmNinjaBuild build("phony");
build.Outputs.emplace_back("");
for (std::string const& ued : unknownExplicitDepends) {
// verify the file is in the build directory
std::string const absDepPath =
cmSystemTools::CollapseFullPath(ued, buildRoot);
if (cmSystemTools::IsSubDirectory(absDepPath, buildRoot)) {
// Generate phony build statement
build.Outputs[0] = ued;
this->WriteBuild(os, build);
// Add to warning on demand
if (warn && warnExplicitDepends.size() < 10) {
warnExplicitDepends.push_back(ued);
}
}
}
}
if (!warnExplicitDepends.empty()) {
std::ostringstream w;
/* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0058) << "\n"
"This project specifies custom command DEPENDS on files "
"in the build tree that are not specified as the OUTPUT or "
"BYPRODUCTS of any add_custom_command or add_custom_target:\n"
" " << cmJoin(warnExplicitDepends, "\n ") <<
"\n"
"For compatibility with versions of CMake that did not have "
"the BYPRODUCTS option, CMake is generating phony rules for "
"such files to convince 'ninja' to build."
"\n"
"Project authors should add the missing BYPRODUCTS or OUTPUT "
"options to the custom commands that produce these files."
;
/* clang-format on */
this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
w.str());
}
}
void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
{
// Write headers.
-14
View File
@@ -23,7 +23,6 @@
#include "cmGlobalCommonGenerator.h"
#include "cmGlobalGeneratorFactory.h"
#include "cmNinjaTypes.h"
#include "cmPolicies.h"
#include "cmStringAlgorithms.h"
#include "cmTransformDepfile.h"
@@ -531,7 +530,6 @@ private:
void WriteTargetAliases(std::ostream& os);
void WriteFolderTargets(std::ostream& os);
void WriteUnknownExplicitDependencies(std::ostream& os);
void WriteBuiltinTargets(std::ostream& os);
void WriteTargetDefault(std::ostream& os);
@@ -566,18 +564,6 @@ private:
/// The set of custom command outputs we have seen.
std::set<std::string> CustomCommandOutputs;
/// Whether we are collecting known build outputs and needed
/// dependencies to determine unknown dependencies.
bool ComputingUnknownDependencies = false;
cmPolicies::PolicyStatus PolicyCMP0058 = cmPolicies::WARN;
/// The combined explicit dependencies of custom build commands
std::set<std::string> CombinedCustomCommandExplicitDependencies;
/// When combined with CombinedCustomCommandExplicitDependencies it allows
/// us to detect the set of explicit dependencies that have
std::set<std::string> CombinedBuildOutputs;
/// The mapping from source file to assumed dependencies.
std::map<std::string, std::set<std::string>> AssumedSourceDependencies;
+8 -32
View File
@@ -1599,41 +1599,17 @@ bool HandleFilesMode(std::vector<std::string> const& args,
return false;
}
cmPolicies::PolicyStatus policyStatus =
helper.Makefile->GetPolicyStatus(cmPolicies::CMP0062);
cmGlobalGenerator* gg = helper.Makefile->GetGlobalGenerator();
for (std::string const& file : filesVector) {
if (gg->IsExportedTargetsFile(file)) {
const char* modal = nullptr;
std::ostringstream e;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (policyStatus) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0062) << "\n";
modal = "should";
CM_FALLTHROUGH;
case cmPolicies::OLD:
break;
case cmPolicies::NEW:
modal = "may";
messageType = MessageType::FATAL_ERROR;
break;
}
if (modal) {
e << "The file\n " << file
<< "\nwas generated by the export() "
"command. It "
<< modal
<< " not be installed with the "
"install() command. Use the install(EXPORT) mechanism "
"instead. See the cmake-packages(7) manual for more.\n";
helper.Makefile->IssueMessage(messageType, e.str());
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
helper.Makefile->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("The file\n ", file, '\n',
"was generated by the export() command. "
"It may not be installed with the install() command. "
"Use the install(EXPORT) mechanism instead. "
"See the cmake-packages(7) manual for more."));
return false;
}
}
+12 -81
View File
@@ -1629,10 +1629,10 @@ void cmLocalGenerator::GetTargetFlags(
exeFlags += " ";
}
std::string cmp0065Flags =
this->GetLinkLibsCMP0065(linkLanguage, *target);
if (!cmp0065Flags.empty()) {
exeFlags += cmp0065Flags;
std::string exeExportFlags =
this->GetExeExportFlags(linkLanguage, *target);
if (!exeExportFlags.empty()) {
exeFlags += exeExportFlags;
exeFlags += " ";
}
@@ -1959,46 +1959,18 @@ void cmLocalGenerator::OutputLinkLibraries(
linkLineComputer->ComputeLinkLibraries(cli, stdLibString, linkLibraries);
}
std::string cmLocalGenerator::GetLinkLibsCMP0065(
std::string cmLocalGenerator::GetExeExportFlags(
std::string const& linkLanguage, cmGeneratorTarget& tgt) const
{
std::string linkFlags;
// Flags to link an executable to shared libraries.
// Flags to export symbols from an executable.
if (tgt.GetType() == cmStateEnums::EXECUTABLE &&
this->StateSnapshot.GetState()->GetGlobalPropertyAsBool(
"TARGET_SUPPORTS_SHARED_LIBS")) {
bool add_shlib_flags = false;
switch (tgt.GetPolicyStatusCMP0065()) {
case cmPolicies::WARN:
if (!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
this->Makefile->PolicyOptionalWarningEnabled(
"CMAKE_POLICY_WARNING_CMP0065")) {
std::ostringstream w;
/* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0065) << "\n"
"For compatibility with older versions of CMake, "
"additional flags may be added to export symbols on all "
"executables regardless of their ENABLE_EXPORTS property.";
/* clang-format on */
this->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to always add the flags, except on AIX where
// we compute symbol exports if ENABLE_EXPORTS is on.
add_shlib_flags =
!(tgt.IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"));
break;
case cmPolicies::NEW:
// NEW behavior is to only add the flags if ENABLE_EXPORTS is on,
// except on AIX where we compute symbol exports.
add_shlib_flags =
!tgt.IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS");
break;
}
if (add_shlib_flags) {
// Only add the flags if ENABLE_EXPORTS is on,
// except on AIX where we compute symbol exports.
if (!tgt.IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS")) {
linkFlags = this->Makefile->GetSafeDefinition(
cmStrCat("CMAKE_SHARED_LIBRARY_LINK_", linkLanguage, "_FLAGS"));
}
@@ -2426,8 +2398,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
static void AddVisibilityCompileOption(std::string& flags,
cmGeneratorTarget const* target,
cmLocalGenerator* lg,
const std::string& lang,
std::string* warnCMP0063)
const std::string& lang)
{
std::string compileOption = "CMAKE_" + lang + "_COMPILE_OPTIONS_VISIBILITY";
cmValue opt = lg->GetMakefile()->GetDefinition(compileOption);
@@ -2440,10 +2411,6 @@ static void AddVisibilityCompileOption(std::string& flags,
if (!prop) {
return;
}
if (warnCMP0063) {
*warnCMP0063 += " " + flagDefine + "\n";
return;
}
if ((*prop != "hidden") && (*prop != "default") && (*prop != "protected") &&
(*prop != "internal")) {
std::ostringstream e;
@@ -2461,7 +2428,6 @@ static void AddVisibilityCompileOption(std::string& flags,
static void AddInlineVisibilityCompileOption(std::string& flags,
cmGeneratorTarget const* target,
cmLocalGenerator* lg,
std::string* warnCMP0063,
const std::string& lang)
{
std::string compileOption =
@@ -2475,10 +2441,6 @@ static void AddInlineVisibilityCompileOption(std::string& flags,
if (!prop) {
return;
}
if (warnCMP0063) {
*warnCMP0063 += " VISIBILITY_INLINES_HIDDEN\n";
return;
}
lg->AppendFlags(flags, *opt);
}
@@ -2489,41 +2451,10 @@ void cmLocalGenerator::AddVisibilityPresetFlags(
return;
}
std::string warnCMP0063;
std::string* pWarnCMP0063 = nullptr;
if (target->GetType() != cmStateEnums::SHARED_LIBRARY &&
target->GetType() != cmStateEnums::MODULE_LIBRARY &&
!target->IsExecutableWithExports()) {
switch (target->GetPolicyStatusCMP0063()) {
case cmPolicies::OLD:
return;
case cmPolicies::WARN:
pWarnCMP0063 = &warnCMP0063;
break;
default:
break;
}
}
AddVisibilityCompileOption(flags, target, this, lang, pWarnCMP0063);
AddVisibilityCompileOption(flags, target, this, lang);
if (lang == "CXX" || lang == "OBJCXX") {
AddInlineVisibilityCompileOption(flags, target, this, pWarnCMP0063, lang);
}
if (!warnCMP0063.empty() && this->WarnCMP0063.insert(target).second) {
std::ostringstream w;
/* clang-format off */
w <<
cmPolicies::GetPolicyWarning(cmPolicies::CMP0063) << "\n"
"Target \"" << target->GetName() << "\" of "
"type \"" << cmState::GetTargetTypeName(target->GetType()) << "\" "
"has the following visibility properties set for " << lang << ":\n" <<
warnCMP0063 <<
"For compatibility CMake is not honoring them for this target.";
/* clang-format on */
target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
MessageType::AUTHOR_WARNING, w.str(), target->GetBacktrace());
AddInlineVisibilityCompileOption(flags, target, this, lang);
}
}
+2 -3
View File
@@ -123,8 +123,8 @@ public:
cmGeneratorTarget const* target,
std::string const& language);
std::string GetLinkLibsCMP0065(std::string const& linkLanguage,
cmGeneratorTarget& tgt) const;
std::string GetExeExportFlags(std::string const& linkLanguage,
cmGeneratorTarget& tgt) const;
cmState* GetState() const;
cmStateSnapshot GetStateSnapshot() const;
@@ -585,7 +585,6 @@ protected:
GeneratorTargetMap GeneratorTargetSearchIndex;
GeneratorTargetVector GeneratorTargets;
std::set<cmGeneratorTarget const*> WarnCMP0063;
GeneratorTargetMap ImportedGeneratorTargets;
GeneratorTargetVector OwnedImportedGeneratorTargets;
std::map<std::string, std::string> AliasTargets;
+5 -33
View File
@@ -1245,9 +1245,6 @@ void cmMakefile::AddDefineFlag(std::string const& flag)
return;
}
// Update the string used for the old DEFINITIONS property.
s_AddDefineFlag(flag, this->DefineFlagsOrig);
// If this is really a definition, update COMPILE_DEFINITIONS.
if (this->ParseDefineFlag(flag, false)) {
return;
@@ -1281,9 +1278,6 @@ void cmMakefile::RemoveDefineFlag(std::string const& flag)
return;
}
// Update the string used for the old DEFINITIONS property.
s_RemoveDefineFlag(flag, this->DefineFlagsOrig);
// If this is really a definition, update COMPILE_DEFINITIONS.
if (this->ParseDefineFlag(flag, true)) {
return;
@@ -1357,7 +1351,6 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
// define flags
this->DefineFlags = parent->DefineFlags;
this->DefineFlagsOrig = parent->DefineFlagsOrig;
// Include transform property. There is no per-config version.
{
@@ -1600,7 +1593,7 @@ void cmMakefile::Configure()
this->SetCheckCMP0000(true);
// Implicitly set the version for the user.
cmPolicies::ApplyPolicyVersion(this, 3, 1, 0,
cmPolicies::ApplyPolicyVersion(this, 3, 5, 0,
cmPolicies::WarnCompat::Off);
}
}
@@ -4002,11 +3995,6 @@ cmStateSnapshot cmMakefile::GetStateSnapshot() const
return this->StateSnapshot;
}
const char* cmMakefile::GetDefineFlagsCMP0059() const
{
return this->DefineFlagsOrig.c_str();
}
cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id,
bool parent_scope) const
{
@@ -4052,10 +4040,10 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
(
// Policies set by cmCoreTryCompile::TryCompileCode.
id == cmPolicies::CMP0065 || id == cmPolicies::CMP0083 ||
id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104 ||
id == cmPolicies::CMP0123 || id == cmPolicies::CMP0126 ||
id == cmPolicies::CMP0128 || id == cmPolicies::CMP0136)) &&
id == cmPolicies::CMP0083 || id == cmPolicies::CMP0091 ||
id == cmPolicies::CMP0104 || id == cmPolicies::CMP0123 ||
id == cmPolicies::CMP0126 || id == cmPolicies::CMP0128 ||
id == cmPolicies::CMP0136)) &&
(!this->IsSet("CMAKE_WARN_DEPRECATED") ||
this->IsOn("CMAKE_WARN_DEPRECATED"))) {
this->IssueMessage(MessageType::DEPRECATION_WARNING,
@@ -4138,22 +4126,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)
-7
View File
@@ -420,8 +420,6 @@ public:
cmMakefile* Makefile;
};
bool IgnoreErrorsCMP0061() const;
std::string const& GetHomeDirectory() const;
std::string const& GetHomeOutputDirectory() const;
@@ -1011,8 +1009,6 @@ public:
cmStateSnapshot GetStateSnapshot() const;
const char* GetDefineFlagsCMP0059() const;
void EnforceDirectoryLevelRules() const;
void AddEvaluationFile(
@@ -1139,9 +1135,6 @@ protected:
std::string ComplainFileRegularExpression;
std::string DefineFlags;
// Track the value of the computed DEFINITIONS property.
std::string DefineFlagsOrig;
#if !defined(CMAKE_BOOTSTRAP)
std::vector<cmSourceGroup> SourceGroups;
size_t ObjectLibrariesSourceGroupIndex;
@@ -397,7 +397,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
}
this->LocalGenerator->AppendFlags(linkFlags,
this->LocalGenerator->GetLinkLibsCMP0065(
this->LocalGenerator->GetExeExportFlags(
linkLanguage, *this->GeneratorTarget));
this->UseLWYU = this->LocalGenerator->AppendLWYUFlags(
+3 -3
View File
@@ -295,16 +295,16 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
WarnCompat warnCompat)
{
// Error on policy versions for which support has been removed.
if (majorVer < 3 || (majorVer == 3 && minorVer < 1)) {
if (majorVer < 3 || (majorVer == 3 && minorVer < 5)) {
if (IsFromLegacyInstallEXPORT(mf, majorVer, minorVer, patchVer)) {
// Silently tolerate cmake_policy calls generated by install(EXPORT)
// in CMake versions prior to 3.18.
majorVer = 3;
minorVer = 1;
minorVer = 5;
patchVer = 0;
} else {
mf->IssueMessage(MessageType::FATAL_ERROR,
"Compatibility with CMake < 3.1 has been removed "
"Compatibility with CMake < 3.5 has been removed "
"from CMake.\n" ADVICE_UPDATE_VERSION_ARGUMENT);
cmSystemTools::SetFatalErrorOccurred();
return false;
+11 -12
View File
@@ -164,33 +164,32 @@ class cmMakefile;
"Only interpret if() arguments as variables or keywords when unquoted.", \
3, 1, 0, NEW) \
SELECT(POLICY, CMP0055, "Strict checking for break() command.", 3, 2, 0, \
WARN) \
NEW) \
SELECT(POLICY, CMP0056, \
"Honor link flags in try_compile() source-file signature.", 3, 2, 0, \
WARN) \
SELECT(POLICY, CMP0057, "Support new IN_LIST if() operator.", 3, 3, 0, \
WARN) \
NEW) \
SELECT(POLICY, CMP0057, "Support new IN_LIST if() operator.", 3, 3, 0, NEW) \
SELECT(POLICY, CMP0058, \
"Ninja requires custom command byproducts to be explicit.", 3, 3, 0, \
WARN) \
NEW) \
SELECT(POLICY, CMP0059, \
"Do not treat DEFINITIONS as a built-in directory property.", 3, 3, \
0, WARN) \
0, NEW) \
SELECT(POLICY, CMP0060, \
"Link libraries by full path even in implicit directories.", 3, 3, \
0, WARN) \
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) \
NEW) \
SELECT(POLICY, CMP0063, \
"Honor visibility properties for all target types.", 3, 3, 0, WARN) \
SELECT(POLICY, CMP0064, "Support new TEST if() operator.", 3, 4, 0, WARN) \
"Honor visibility properties for all target types.", 3, 3, 0, NEW) \
SELECT(POLICY, CMP0064, "Support new TEST if() operator.", 3, 4, 0, NEW) \
SELECT(POLICY, CMP0065, \
"Do not add flags to export symbols from executables without " \
"the ENABLE_EXPORTS target property.", \
3, 4, 0, WARN) \
3, 4, 0, NEW) \
SELECT(POLICY, CMP0066, \
"Honor per-config flags in try_compile() source-file signature.", 3, \
7, 0, WARN) \
-1
View File
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0057 NEW)
project(CompileFeatures)
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0058 OLD)
project(CustomCommandByproducts C)
# Generate a byproduct in a rule that runs in the target consuming it.
@@ -203,10 +202,3 @@ target_link_libraries(
ExternalLibraryByproducts_WithInstallDirSubstitution
ExternalLibraryWithInstallDirSubstitution
)
if(CMAKE_GENERATOR STREQUAL "Ninja")
add_custom_target(CheckNinja ALL
COMMENT "Checking build.ninja"
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/ninja-check.cmake
)
endif()
@@ -1,20 +0,0 @@
file(READ build.ninja build_ninja)
if("${build_ninja}" MATCHES [====[
# Unknown Build Time Dependencies.
# Tell Ninja that they may appear as side effects of build rules
# otherwise ordered by order-only dependencies.
((build [^:]*: phony[^\n]*
)*)# ========]====])
set(phony "${CMAKE_MATCH_1}")
if(NOT phony)
message(STATUS "build.ninja correctly does not have extra phony rules")
else()
string(REGEX REPLACE "\n+$" "" phony "${phony}")
string(REGEX REPLACE "\n" "\n " phony " ${phony}")
message(FATAL_ERROR "build.ninja incorrectly has extra phony rules:\n"
"${phony}")
endif()
else()
message(FATAL_ERROR "build.ninja is incorrectly missing expected block")
endif()
@@ -25,8 +25,6 @@ set (GENERATE_CONTENT "if (\"${CMAKE_TAPI}\")
endif()\n\n")
string (APPEND GENERATE_CONTENT [[
cmake_policy (SET CMP0057 NEW)
macro (CHECK_FILE test_msg path)
if (NOT EXISTS "${path}")
string (APPEND RunCMake_TEST_FAILED "${test_msg}: \"${path}\" not found\n")
@@ -1,4 +1,4 @@
CMake Error at CMP0055-NEW-Out-of-Scope.cmake:4 \(break\):
CMake Error at CMP0055-NEW-Out-of-Scope.cmake:1 \(break\):
A BREAK command was found outside of a proper FOREACH or WHILE loop scope.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
@@ -1,4 +1 @@
cmake_policy(SET CMP0055 NEW)
break()
@@ -1,4 +1,4 @@
CMake Error at CMP0055-NEW-Reject-Arguments.cmake:5 \(break\):
CMake Error at CMP0055-NEW-Reject-Arguments.cmake:2 \(break\):
The BREAK command does not accept any arguments.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
@@ -1,6 +1,3 @@
cmake_policy(SET CMP0055 NEW)
foreach(i RANGE 1 2)
break(1)
endforeach()
endforeach()
@@ -1 +0,0 @@
0
@@ -1,10 +0,0 @@
^CMake Deprecation Warning at CMP0055-OLD-Out-of-Scope.cmake:[0-9]+ \(cmake_policy\):
The OLD behavior for policy CMP0055 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\)$
@@ -1,4 +0,0 @@
cmake_policy(SET CMP0055 OLD)
break()
@@ -1 +0,0 @@
0
@@ -1,10 +0,0 @@
^CMake Deprecation Warning at CMP0055-OLD-Reject-Arguments.cmake:[0-9]+ \(cmake_policy\):
The OLD behavior for policy CMP0055 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\)$
@@ -1,6 +0,0 @@
cmake_policy(SET CMP0055 OLD)
foreach(i RANGE 1 2)
break(1)
endforeach()
@@ -1 +0,0 @@
0
@@ -1,9 +0,0 @@
CMake Warning \(dev\) at CMP0055-WARN-Out-of-Scope.cmake:2 \(break\):
Policy CMP0055 is not set: Strict checking for break\(\) command. Run "cmake
--help-policy CMP0055" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
A BREAK command was found outside of a proper FOREACH or WHILE loop scope.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
@@ -1,2 +0,0 @@
break()
@@ -1 +0,0 @@
0
@@ -1,9 +0,0 @@
CMake Warning \(dev\) at CMP0055-WARN-Reject-Arguments.cmake:3 \(break\):
Policy CMP0055 is not set: Strict checking for break\(\) command. Run "cmake
--help-policy CMP0055" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
The BREAK command does not accept any arguments.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
@@ -1,4 +0,0 @@
foreach(i RANGE 1 2)
break(1)
endforeach()
+1 -1
View File
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
@@ -1,10 +1,4 @@
include(RunCMake)
set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
run_cmake(CMP0055-OLD-Out-of-Scope)
run_cmake(CMP0055-NEW-Out-of-Scope)
run_cmake(CMP0055-WARN-Out-of-Scope)
run_cmake(CMP0055-OLD-Reject-Arguments)
run_cmake(CMP0055-NEW-Reject-Arguments)
run_cmake(CMP0055-WARN-Reject-Arguments)
-2
View File
@@ -1,5 +1,3 @@
cmake_policy(SET CMP0057 NEW)
set(MY_NON_EXISTENT_LIST)
set(MY_EMPTY_LIST "")
@@ -1 +0,0 @@
1
@@ -1,8 +0,0 @@
CMake Error at CMP0057-OLD.cmake:5 \(if\):
if given arguments:
"foo" "IN_LIST" "MY_LIST"
Unknown arguments specified
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-7
View File
@@ -1,7 +0,0 @@
cmake_policy(SET CMP0057 OLD)
set(MY_LIST foo bar)
if("foo" IN_LIST MY_LIST)
message("foo is in MY_LIST")
endif()

Some files were not shown because too many files have changed in this diff Show More