summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCXXCompilerFlag.cmake
diff options
context:
space:
mode:
authorMark Abraham <mark.j.abraham@gmail.com>2015-02-24 13:20:16 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-24 14:45:19 (GMT)
commit5d5067ae57c9d02656a54076cdf121c7084a4de3 (patch)
treebfbe84f773aa8c2c7770b942fe383d7cde8f9362 /Modules/CheckCXXCompilerFlag.cmake
parentac80f0f95fc7cfbad17c2a5656a87e346b9f298a (diff)
downloadCMake-5d5067ae57c9d02656a54076cdf121c7084a4de3.zip
CMake-5d5067ae57c9d02656a54076cdf121c7084a4de3.tar.gz
CMake-5d5067ae57c9d02656a54076cdf121c7084a4de3.tar.bz2
Check*CompilerFlag: Refactor method used to pass flags
Refactor the Check*CompilerFlag modules to pass the flags to Check*SourceCompiles using CMAKE_REQUIRED_FLAGS instead of CMAKE_REQUIRED_DEFINITIONS. Both end up being used, but the variable for "FLAGS" is more precise.
Diffstat (limited to 'Modules/CheckCXXCompilerFlag.cmake')
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index fab3a05..71b3fd2 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -12,7 +12,7 @@
# <var> - variable to store the result
#
# This internally calls the check_cxx_source_compiles macro and sets
-# CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for
+# CMAKE_REQUIRED_FLAGS to <flag>. See help for
# CheckCXXSourceCompiles for a listing of variables that can otherwise
# modify the build. The result only tells that the compiler does not
# give an error message when it encounters the flag. If the flag has
@@ -37,8 +37,8 @@ include(CheckCXXSourceCompiles)
include(CMakeCheckCompilerFlagCommonPatterns)
macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
- set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
- set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+ set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
# Normalize locale during test compilation.
set(_CheckCXXCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
@@ -59,6 +59,6 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
unset(_CheckCXXCompilerFlag_LOCALE_VARS)
unset(_CheckCXXCompilerFlag_COMMON_PATTERNS)
- set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+ set (CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
endmacro ()