瀏覽代碼

Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES"

This reverts commit v3.11.0-rc1~108^2 (CheckIncludeFiles: Honor
CMAKE_REQUIRED_LIBRARIES, 2017-12-24).  The behavior change can
affect checks in existing projects that don't expect the behavior.
Introducing the behavior again will require a policy.

Fixes: #17874
Issue: #9514
Brad King 7 年之前
父節點
當前提交
35109e718b
共有 4 個文件被更改,包括 16 次插入18 次删除
  1. 16 9
      Help/release/3.11.rst
  2. 0 3
      Modules/CheckIncludeFile.cmake
  3. 0 3
      Modules/CheckIncludeFileCXX.cmake
  4. 0 3
      Modules/CheckIncludeFiles.cmake

+ 16 - 9
Help/release/3.11.rst

@@ -127,15 +127,6 @@ Properties
 Modules
 -------
 
-* The :module:`CheckIncludeFile` module ``check_include_file`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
-* The :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
-* The :module:`CheckIncludeFiles` module ``check_include_files`` macro
-  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
-
 * The :module:`CheckIncludeFiles` module :command:`CHECK_INCLUDE_FILES`
   command gained a ``LANGUAGE`` option to specify whether to check using the
   ``C`` or ``CXX`` compiler.
@@ -276,3 +267,19 @@ Other Changes
   values containing newlines are now truncated before writing to the file.
   In addition, a warning comment is written to the cache file, and a warning
   message is displayed to the user on the console.
+
+Updates
+=======
+
+Changes made since CMake 3.11.0 include the following.
+
+3.11.1
+------
+
+* The :module:`CheckIncludeFile` module ``check_include_file`` macro,
+  :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro,
+  and :module:`CheckIncludeFiles` module ``check_include_files`` macro
+  were taught to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable in
+  CMake 3.11.0.  This has been reverted due to changing behavior of
+  checks for existing projects.  It may be restored in the future
+  with a policy for compatibility.

+ 0 - 3
Modules/CheckIncludeFile.cmake

@@ -27,8 +27,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -61,7 +59,6 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"

+ 0 - 3
Modules/CheckIncludeFileCXX.cmake

@@ -27,8 +27,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -60,7 +58,6 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"

+ 0 - 3
Modules/CheckIncludeFiles.cmake

@@ -33,8 +33,6 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -104,7 +102,6 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${src}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
       "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"