summaryrefslogtreecommitdiffstats
path: root/src/core/CMakeLists.txt
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-07-06 07:57:46 +0200
committerMichal Klocek <michal.klocek@qt.io>2021-07-07 01:04:18 +0200
commitb1a6adf731828b1f68f51480eeb21dd9e7d3ba1e (patch)
treead24c582e89bc4a19a3431dbd130feed5817c698 /src/core/CMakeLists.txt
parent05a7dba5c2733b5893fbea8aac89af5df13d53fb (diff)
Add arm optimization flags to cmake build
Pick-to: dev Change-Id: Ibab4630fd226f46f58d08c603436dc2c378212ec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/CMakeLists.txt')
-rw-r--r--src/core/CMakeLists.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 58cf9c48b..7feb1ec40 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -514,6 +514,40 @@ foreach(config ${configs})
ARGS use_xscrnsaver
CONDITION XSCRNSAVER_FOUND
)
+
+ if(CMAKE_CROSSCOMPILING AND cpu STREQUAL "arm")
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_tune
+ CFLAG mtune
+ )
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_float_abi
+ CFLAG mfloat-abi
+ )
+ extend_gn_list_cflag(gnArgArg
+ ARG arm_arch
+ CFLAG march
+ )
+ extract_cflag(cflag "mfpu")
+ get_arm_version(arm_version "${cflag}")
+ extend_gn_list(gnArgArg
+ ARGS arm_use_neon
+ CONDITION (arm_version GREATER_EQUAL 8) OR ("${cflag}" MATCHES ".*neon.*")
+ )
+ if(arm_version EQUAL 7 AND NOT "${cflag}" MATCHES ".*neon.*")
+ # If the toolchain does not explicitly specify to use NEON instructions
+ # we use arm_neon_optional for ARMv7
+ list(APPEND gnArgArg arm_optionally_use_neon=true)
+ endif()
+ check_thumb(armThumb)
+ extend_gn_list(gnArgArg
+ ARGS arm_use_thumb
+ CONDITION armThumb
+ )
+ if(NOT armThumb AND NOT QT_FEATURE_system_ffmpeg)
+ list(APPEND gnArgArg media_use_ffmpeg=false use_webaudio_ffmpeg=false)
+ endif()
+ endif()
endif()
if(MACOS)