diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-19 16:49:13 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-20 17:07:46 +0200 |
commit | df28355981e14c90dc0f214ceeba40be77401fb4 (patch) | |
tree | a2eb561965f1d77a68310b1635a910f71347ffa6 /cmake/QtFeature.cmake | |
parent | 45d3c75ab6f29e88637363869a3b0be8df731dec (diff) |
CMake: Support configure tests of type 'compilerSupportsFlag'
Task-number: QTBUG-86155
Change-Id: Iaa5c48b6508870a0f6afdf9df66cd2e634fe19b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index f7765cea94..5002a53352 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -1,4 +1,5 @@ include(QtFeatureCommon) +include(CheckCXXCompilerFlag) function(qt_feature_module_begin) qt_parse_all_arguments(arg "qt_feature_module_begin" @@ -870,6 +871,16 @@ function(qt_config_compile_test_machine_tuple label) set(TEST_machine_tuple "${output}" CACHE INTERNAL "${label}") endfunction() +function(qt_config_compiler_supports_flag_test name) + if(DEFINED "TEST_${name}") + return() + endif() + + cmake_parse_arguments(arg "" "LABEL;FLAG" "" ${ARGN}) + check_cxx_compiler_flag("${arg_FLAG}" TEST_${name}) + set(TEST_${name} "${TEST_${name}}" CACHE INTERNAL "${label}") +endfunction() + function(qt_make_features_available target) if(NOT "${target}" MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-Z0-9_-]*$") message(FATAL_ERROR "${target} does not match ${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-Z0-9_-]*. INVALID NAME.") |