summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeature.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r--cmake/QtFeature.cmake11
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.")