diff options
author | Arvid Nilsson <anilsson@blackberry.com> | 2013-11-27 15:00:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-27 17:33:06 +0100 |
commit | 2970bae1db1abb153e4a7b3f6c8ceb0759ea337f (patch) | |
tree | cd1de1aed6df222102a7e33ec45efae78e13a1db | |
parent | a76b4dc82edb78cf0b7e24bcd6ca9fb986ba2cca (diff) |
Improved ARM cross-compile settings detection
Let the Chromium build system figure out default values if a flag can't
be deduced from the QMAKE_CFLAGS. For example, this allows Chromium to
default to ARM v7 if no ARM version can be deduced from compiler flags.
Change-Id: I47257a7fc27cdbca84c6999dba75affe809f753b
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rw-r--r-- | build/build.pro | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/build/build.pro b/build/build.pro index 9f955a16e..e0c8b4af1 100644 --- a/build/build.pro +++ b/build/build.pro @@ -11,22 +11,33 @@ cross_compile { !isEmpty(TOOLCHAIN_SYSROOT): GYP_ARGS += "-D sysroot=\"$${TOOLCHAIN_SYSROOT}\"" contains(QT_ARCH, "arm") { - # Extract ARM specific compiler options that we have to pass to gyp + GYP_ARGS += "-D target_arch=arm" + + # Extract ARM specific compiler options that we have to pass to gyp, + # but let gyp figure out a default if an option is not present. MARCH = $$extractCFlag("-march=.*") + !isEmpty(MARCH): GYP_ARGS += "-D arm_arch=\"$$MARCH\"" + MFPU = $$extractCFlag("-mfpu=.*") + !isEmpty(MFPU) { + GYP_ARGS += "-D arm_fpu=\"$$MFPU\"" + contains(MFPU, "neon"): GYP_ARGS += "-D arm_neon=\"$$NEON\"" + } + MTUNE = $$extractCFlag("-mtune=.*") + !isEmpty(MTUNE): GYP_ARGS += "-D arm_tune=\"$$MTUNE\"" + MFLOAT = $$extractCFlag("-mfloat-abi=.*") + !isEmpty(MFLOAT): GYP_ARGS += "-D arm_float_abi=\"$$MFLOAT\"" + MARMV = $$replace(MARCH, "armv",) - MARMV = $$split(MARMV,) - MARMV = $$member(MARMV, 0) - MTHUMB = 0 - contains(QMAKE_CFLAGS, "-mthumb"): MTHUMB = 1 - NEON = 0 - contains(MFPU, "neon"): NEON = 1 - - GYP_ARGS += "-D target_arch=arm -D arm_version=\"$$MARMV\" -D arm_arch=\"$$MARCH\"" \ - "-D arm_tune=\"$$MTUNE\" -D arm_fpu=\"$$MFPU\" -D arm_float_abi=\"$$MFLOAT\"" \ - "-D arm_thumb=\"$$MTHUMB\" -D arm_neon=\"$$NEON\"" + !isEmpty(MARMV) { + MARMV = $$split(MARMV,) + MARMV = $$member(MARMV, 0) + GYP_ARGS += "-D arm_version=\"$$MARMV\"" + } + + contains(QMAKE_CFLAGS, "-mthumb"): GYP_ARGS += "-D arm_thumb=1" } # Needed for v8, see chromium/v8/build/toolchain.gypi |