diff options
Diffstat (limited to 'Modules/CheckCXXCompilerFlag.cmake')
-rw-r--r-- | Modules/CheckCXXCompilerFlag.cmake | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 544e9ac..3bc3463 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -34,24 +34,8 @@ effect or even a specific one is beyond the scope of this module. include_guard(GLOBAL) include(CheckCXXSourceCompiles) -include(CMakeCheckCompilerFlagCommonPatterns) - -function(check_cxx_compiler_flag _flag _var) - set(CMAKE_REQUIRED_DEFINITIONS "${_flag}") - - # Normalize locale during test compilation. - set(_locale_vars LC_ALL LC_MESSAGES LANG) - foreach(v IN LISTS _locale_vars) - set(_locale_vars_saved_${v} "$ENV{${v}}") - set(ENV{${v}} C) - endforeach() - check_compiler_flag_common_patterns(_common_patterns) - check_cxx_source_compiles("int main() { return 0; }" ${_var} - # Some compilers do not fail with a bad flag - FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU - ${_common_patterns} - ) - foreach(v IN LISTS _locale_vars) - set(ENV{${v}} ${_locale_vars_saved_${v}}) - endforeach() -endfunction() +include(Internal/CheckCompilerFlag) + +macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) + cmake_check_compiler_flag(CXX "${_FLAG}" ${_RESULT}) +endmacro () |