summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <[email protected]>2025-06-26 13:19:02 +0800
committerTim Blechmann <[email protected]>2025-07-07 16:42:22 +0800
commite00c3808a29279cfaf5f62f3fed5894c9cefe521 (patch)
treed6726c1996e763cc4411e749d204b8b0b6aec6cc
parentfde2ec282e4e7268379695ce0e50e53a21f53d2c (diff)
CMake: pass -mcx16 for clang/mingw builds on win64HEADdev
Windows 10 requires the cmpxchg16b instruction to be available. Enabling it for clang/mingw allows us to use cpp_winrt. Task-number: QTBUG-115078 Pick-to: 6.10 Change-Id: I6ac5afa1c592e9d42f7712aca1062ecc9251d52d Reviewed-by: Thiago Macieira <[email protected]>
-rw-r--r--cmake/QtInternalTargets.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index 1b0adccd5b5..c041f9d3ac5 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -368,6 +368,13 @@ if (MSVC AND NOT CLANG)
)
endif()
+if (WIN32 AND (CLANG OR MINGW) AND (TEST_architecture_arch STREQUAL x86_64))
+ # windows 10 requires cmpxchg16b
+ target_compile_options(PlatformCommonInternal INTERFACE
+ -mcx16
+ )
+endif()
+
set(_qt_internal_clang_msvc_frontend False)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")