From edd8f2840d85e35bbec905440b0b524d7e0d108e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 9 Feb 2017 12:00:15 +0100 Subject: Support cross-builds and alternative compilers with GN Adds GN versions of the gyp_configure targets, to create custom toolchains we can use to override compilers used by GN. Change-Id: Ic3a9cb7e83f845180396faff632f72f9c24f3365 Reviewed-by: Michal Klocek --- tools/qmake/mkspecs/features/configure.prf | 3 +-- tools/qmake/mkspecs/features/functions.prf | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'tools/qmake') diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf index b17626c3e..f12bf5ae9 100644 --- a/tools/qmake/mkspecs/features/configure.prf +++ b/tools/qmake/mkspecs/features/configure.prf @@ -35,7 +35,7 @@ defineTest(runConfigure) { } isQtMinimum(5, 9) { qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code - linux: !cross_compile: WEBENGINE_CONFIG += use_gn + linux: WEBENGINE_CONFIG += use_gn macos: WEBENGINE_CONFIG += use_gn win32: WEBENGINE_CONFIG += use_gn } @@ -57,7 +57,6 @@ defineTest(runConfigure) { packagesExist("\'glib-2.0 >= 2.32.0\'"): WEBENGINE_CONFIG += use_glib else: skipBuild("System glib is too old (min. version 2.32).$${EOL}") } - !contains(WEBENGINE_CONFIG, embedded_build): REQUIRED_PACKAGES += libpci for(package, $$list($$REQUIRED_PACKAGES)) { !packagesExist($$package):skipBuild("Unmet dependency: $$package") diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 6ef87f867..5e294b96b 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -411,6 +411,25 @@ defineReplace(gnArgs) { return($$gn_args) } +defineReplace(gnArch) { + qtArch = $$1 + contains(qtArch, "i386"): return(x86) + contains(qtArch, "x86_64"): return(x64) + contains(qtArch, "arm"): return(arm) + contains(qtArch, "arm64"): return(arm64) + contains(qtArch, "mips"): return(mipsel) + contains(qtArch, "mips64"): return(mips64el) + return(unknown) +} + +defineReplace(gnOS) { + macos: return(mac) + win32: return(win) + linux: return(linux) + error(Unsupported platform) + return(unknown) +} + defineTest(skipBuild) { skipBuildReason = "$$skipBuildReason $${EOL}$$1" export(skipBuildReason) -- cgit v1.2.3