summaryrefslogtreecommitdiffstats
path: root/config.tests
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-31 11:43:22 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-02-07 18:19:51 +0000
commit1c571e5fe7a31e7accb04b37a1d3bd7c8855d05c (patch)
tree65241f1258136d0c45bcaa3b51e1393a2f595e6a /config.tests
parent2145cdc54d5812793310f7e3b3709bfa2648bd50 (diff)
parent4e7af2061e8c323b2a21f0549643a2cfab191664 (diff)
Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"
Diffstat (limited to 'config.tests')
-rw-r--r--config.tests/arch/CMakeLists.txt6
-rw-r--r--config.tests/x86_simd/CMakeLists.txt23
2 files changed, 29 insertions, 0 deletions
diff --git a/config.tests/arch/CMakeLists.txt b/config.tests/arch/CMakeLists.txt
new file mode 100644
index 0000000000..c0873a984f
--- /dev/null
+++ b/config.tests/arch/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.15.0)
+project(arch LANGUAGES CXX)
+
+add_executable(architecture_test)
+set_property(TARGET architecture_test PROPERTY MACOSX_BUNDLE FALSE)
+target_sources(architecture_test PRIVATE arch.cpp)
diff --git a/config.tests/x86_simd/CMakeLists.txt b/config.tests/x86_simd/CMakeLists.txt
new file mode 100644
index 0000000000..b624b7bc95
--- /dev/null
+++ b/config.tests/x86_simd/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.14.0)
+project(x86_simd LANGUAGES CXX)
+
+include(../../cmake/QtPlatformSupport.cmake)
+include(../../cmake/QtCompilerOptimization.cmake)
+
+# FIXME: Make the this project handle a list of SIMD entries.
+# FIXME: Make this project handle appending of the cflags (similar to the qmake project).
+# This is needed for the x86SimdAlways configure test (
+# aka we test to see if setting no SIMD (-msse2) cflags at all, will result in their implicit
+# addition by the compiler).
+string(TOUPPER "${SIMD}" upper_simd)
+
+if(NOT DEFINED "QT_CFLAGS_${upper_simd}")
+ # Don't use CMake error() because a configure error also fails the try_compile() call.
+ # Instead use a compile flag that doesn't exist to force a compiler error.
+ set(QT_CFLAGS_${upper_simd} "--qt-cflags-not-found")
+endif()
+
+add_executable("SimdTest${SIMD}")
+target_sources("SimdTest${SIMD}" PRIVATE main.cpp)
+target_compile_options("SimdTest${SIMD}" PRIVATE ${QT_CFLAGS_${upper_simd}})
+target_compile_definitions("SimdTest${SIMD}" PRIVATE QT_COMPILER_SUPPORTS_${upper_simd})