From b4a6b285ef77c635677ec61f47f54f3f98100658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 20 Sep 2024 11:53:30 +0200 Subject: [PATCH] testlib: Enable -tickcounter on Apple Silicon The cycle_p.h header assumes the configure system will set up various HAVE_FOO defines, which we were not doing. We now selectively use ARMV8_PMCCNTR_EL0 on Apple Silicon. This is in line with the upstream change in https://github.com/FFTW/fftw3/commit/7e92d5 We can't use DEFINES, as CMake doesn't allow function macros in defines, so we manually use COMPILE_OPTIONS, as we know Clang supports this. For Intel the cycle_p.h header already does the right thing based purely on the compiler-available defines. Change-Id: Ib3da05c203955a6a377ba0eeb624f1cb430931e1 Reviewed-by: Alexey Edelev Reviewed-by: Thiago Macieira (cherry picked from commit fd00d5569e738d2536c05b2fc3ef2517f415b272) Reviewed-by: Qt Cherry-pick Bot --- src/testlib/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 391c9de9937..b2a59707169 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -123,6 +123,12 @@ qt_internal_extend_target(Test CONDITION APPLE qappletestlogger.cpp qappletestlogger_p.h PUBLIC_LIBRARIES ${FWSecurity} + + # cycle_p.h expects the configure system to set up these defines. + # Pass through COMPILE_OPTIONS instead of DEFINES, as we know + # Clang supports defines with function macros on the command line. + COMPILE_OPTIONS + "-DHAVE_ARMV8_CNTVCT_EL0='defined(Q_PROCESSOR_ARM)'" ) qt_internal_extend_target(Test CONDITION MACOS