summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-14 11:21:43 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-14 13:39:34 +0000
commit70a8caaf69224ffd55391d72f6f5693a15e4f8b7 (patch)
tree059902cfe16cb019f8c1743de3d9a441a6d096bf /src/core
parent4310260063b6358808dff2fd2758b73e82503a29 (diff)
Port ARM configuration to GN
Detect ARM configuration and pass it to GN. Change-Id: I809db0e096dc8c8785b37990769d4a981b147624 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/config/linux.pri37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 232cf2ddd..e5d48539d 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -40,6 +40,43 @@ use?(gn) {
!isEmpty(TOOLCHAIN_SYSROOT): gn_args += target_sysroot=\"$${TOOLCHAIN_SYSROOT}\"
}
+ contains(QT_ARCH, "arm") {
+ # Extract ARM specific compiler options that we have to pass to gn,
+ # but let gn figure out a default if an option is not present.
+ MTUNE = $$extractCFlag("-mtune=.*")
+ !isEmpty(MTUNE): gn_args += arm_tune=\"$$MTUNE\"
+
+ MFLOAT = $$extractCFlag("-mfloat-abi=.*")
+ !isEmpty(MFLOAT): gn_args += arm_float_abi=\"$$MFLOAT\"
+
+ MARCH = $$extractCFlag("-march=.*")
+
+ MARMV = $$replace(MARCH, "armv",)
+ !isEmpty(MARMV) {
+ MARMV = $$split(MARMV,)
+ MARMV = $$member(MARMV, 0)
+ lessThan(MARMV, 6): error("$$MARCH architecture is not supported")
+ gn_args += arm_version=$$MARMV
+ }
+
+ !lessThan(MARMV, 8) {
+ gn_args += arm_use_neon=true
+ } else {
+ MFPU = $$extractCFlag("-mfpu=.*")
+ !isEmpty(MFPU):contains(MFPU, ".*neon.*") {
+ gn_args += arm_use_neon=true
+ } else {
+ gn_args += arm_use_neon=false
+ # If the toolchain does not explicitly specify to use NEON instructions
+ # we use arm_neon_optional for ARMv7
+ equals(MARMV, 7): gn_args += arm_optionally_use_neon=true
+ }
+ }
+
+ if(isEmpty(MARMV)|lessThan(MARMV, 7)):contains(QMAKE_CFLAGS, "-marm"): gn_args += arm_use_thumb=false
+ else: contains(QMAKE_CFLAGS, "-mthumb"): gn_args += arm_use_thumb=true
+ }
+
host_build {
gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\"
# Don't bother trying to use system libraries in this case