summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/QtInternalTargets.cmake15
-rw-r--r--config_help.txt1
-rw-r--r--configure.cmake3
-rw-r--r--qt_cmdline.cmake1
4 files changed, 19 insertions, 1 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index b60a8b2601..78c5ec898e 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -278,6 +278,21 @@ if (GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.2")
target_compile_options(PlatformCommonInternal INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-Wsuggest-override>)
endif()
+if(QT_FEATURE_intelcet)
+ if(MSVC)
+ target_compile_options(PlatformCommonInternal INTERFACE
+ -guard:ehcont
+ )
+ target_link_options(PlatformCommonInternal INTERFACE
+ -guard:ehcont -CETCOMPAT
+ )
+ else()
+ target_compile_options(PlatformCommonInternal INTERFACE
+ -fcf-protection
+ )
+ endif()
+endif()
+
if(QT_FEATURE_force_asserts)
target_compile_definitions(PlatformCommonInternal INTERFACE QT_FORCE_ASSERTS)
endif()
diff --git a/config_help.txt b/config_help.txt
index fc978bb446..2a97f525ea 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -137,6 +137,7 @@ Build options:
-pch ................. Use precompiled headers [auto]
-ltcg ................ Use Link Time Code Generation [no]
+ -intelcet ............ Use Intel Control-flow Enforcement Technology [no]
-linker [bfd,gold,lld,mold]
Force use of the GNU ld, GNU gold, LLVM/LLD or mold
linker instead of default one (GCC and clang only)
diff --git a/configure.cmake b/configure.cmake
index 2274f1554d..30d9551b6b 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1034,7 +1034,7 @@ qt_feature("relocatable" PRIVATE
)
qt_feature("intelcet" PRIVATE
LABEL "Using Intel CET"
- CONDITION TEST_intelcet
+ CONDITION ( INPUT_intelcet STREQUAL yes ) OR TEST_intelcet
)
qt_configure_add_summary_build_type_and_config()
qt_configure_add_summary_section(NAME "Build options")
@@ -1085,6 +1085,7 @@ qt_configure_add_summary_entry(
qt_configure_add_summary_entry(ARGS "relocatable")
qt_configure_add_summary_entry(ARGS "precompile_header")
qt_configure_add_summary_entry(ARGS "ltcg")
+qt_configure_add_summary_entry(ARGS "intelcet")
qt_configure_add_summary_section(NAME "Target compiler supports")
qt_configure_add_summary_entry(
TYPE "featureList"
diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake
index d5774bb14c..a6dd809bf6 100644
--- a/qt_cmdline.cmake
+++ b/qt_cmdline.cmake
@@ -67,6 +67,7 @@ qt_commandline_option(incredibuild-xge TYPE boolean NAME incredibuild_xge)
qt_commandline_option(libudev TYPE boolean)
qt_commandline_option(linker TYPE optionalString VALUES bfd gold lld mold)
qt_commandline_option(ltcg TYPE boolean)
+qt_commandline_option(intelcet TYPE boolean)
# special case begin
qt_commandline_option(make TYPE addString VALUES examples libs tests tools
benchmarks manual-tests minimal-static-tests)