summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-30 17:34:30 +0000
committerKitware Robot <kwrobot@kitware.com>2020-11-30 12:37:14 -0500
commit0a9f19c0eafc6015d0820a5b9f91feb67fd7a731 (patch)
tree17ee3e333fd13be0b12a62b36ed01db85bb74abd /Modules
parent7b0c5fc3dc25eae6539752fc732b9e3b167091d6 (diff)
parent72f6b4bfbe84a369fbdf4c9671470ba8c3ce14cc (diff)
downloadcmake-0a9f19c0eafc6015d0820a5b9f91feb67fd7a731.tar.gz
Merge topic 'correct_check_compiler_flag_regression'
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kumar Gala <kumar.gala@gmail.com> Merge-request: !5540
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckPIESupported.cmake8
-rw-r--r--Modules/Compiler/GNU.cmake1
-rw-r--r--Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake (renamed from Modules/Internal/CMakeCheckCompilerFlag.cmake)6
3 files changed, 8 insertions, 7 deletions
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index a99d8c41f1..fb87822462 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -62,7 +62,7 @@ Examples
#]=======================================================================]
-include (Internal/CMakeCheckCompilerFlag)
+include (Internal/CMakeTryCompilerOrLinkerFlag)
function (check_pie_supported)
cmake_policy(GET CMP0083 cmp0083)
@@ -109,14 +109,16 @@ function (check_pie_supported)
foreach(lang IN LISTS CHECK_PIE_LANGUAGES)
if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER)
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
CMAKE_${lang}_LINK_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_PIE_SUPPORTED)
string (APPEND outputs "PIE (${lang}): ${output}\n")
endif()
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
CMAKE_${lang}_LINK_NO_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_NO_PIE_SUPPORTED)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 668a6a9b20..81ab3a2f70 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -9,7 +9,6 @@ endif()
set(__COMPILER_GNU 1)
include(Compiler/CMakeCommonCompilerMacros)
-include(Internal/CMakeCheckCompilerFlag)
set(__pch_header_C "c-header")
set(__pch_header_CXX "c++-header")
diff --git a/Modules/Internal/CMakeCheckCompilerFlag.cmake b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
index 9c8dfb6171..d6fa5f0a67 100644
--- a/Modules/Internal/CMakeCheckCompilerFlag.cmake
+++ b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
@@ -6,13 +6,13 @@
NOTE: This function is used internally by CMake. Projects should not include
this file directly.
-The cmake_check_compiler_flag() function can be used to compile and link a
+The cmake_try_compiler_or_linker_flag() function can be used to compile and link a
source file to check whether a specific compiler or linker flag is supported.
The function does not use the try_compile() command so as to avoid infinite
recursion. It may not work for all platforms or toolchains, the caller is
responsible for ensuring it is only called in valid situations.
- cmake_check_compiler_flag(<lang> <flag> <result>
+ cmake_try_compiler_or_linker_flag(<lang> <flag> <result>
[SRC_EXT <ext>] [COMMAND_PATTERN <pattern>]
[FAIL_REGEX <regex> ...]
[OUTPUT_VARIABLE <output>])
@@ -39,7 +39,7 @@ Optional parameters:
include_guard(GLOBAL)
include(CMakeCheckCompilerFlagCommonPatterns)
-function(CMAKE_CHECK_COMPILER_FLAG lang flag result)
+function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result)
# Cache results between runs similar to check_<lang>_source_compiles()
if(DEFINED ${result})
return()