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.

Pick-to: 6.8
Change-Id: Ib3da05c203955a6a377ba0eeb624f1cb430931e1
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Tor Arne Vestbø 2024-09-20 11:53:30 +02:00
parent cce81f296e
commit fd00d5569e

View File

@ -129,6 +129,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