mkspecs: Allow specifying a CROSS_COMPILE for mac/clang targets

This allows distinguishing between these tools and tools for the host,
when cross compiling.

While mac tools normally only are available on macOS, there are third
party efforts to port them to other platforms. In these cases, it
might be useful to use a prefix (either some sort of triplet prefix,
or an absolute path) to distinguish between the host build platform
compilers/tools and the ones for the cross target.

The use of this variable matches the one used in a lot of other
mkspecs, and shouldn't cause any issues for those who aren't setting
it.

Change-Id: Iaeba571d955ea79ed1249989fcc525eb1eaf1f5c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
Martin Storsjö 2018-06-14 15:54:37 +03:00
parent 5a68ce07bd
commit 22e9ff9c16
2 changed files with 6 additions and 6 deletions

View File

@ -4,8 +4,8 @@
QMAKE_COMPILER = gcc clang llvm # clang pretends to be gcc
QMAKE_CC = clang
QMAKE_CXX = clang++
QMAKE_CC = $${CROSS_COMPILE}clang
QMAKE_CXX = $${CROSS_COMPILE}clang++
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC

View File

@ -43,9 +43,9 @@ QMAKE_WAYLAND_SCANNER = wayland-scanner
QMAKE_ACTOOL = actool
QMAKE_DSYMUTIL = dsymutil
QMAKE_STRIP = strip
QMAKE_STRIP = $${CROSS_COMPILE}strip
QMAKE_STRIPFLAGS_LIB += -S -x
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
QMAKE_NM = nm -P
QMAKE_AR = $${CROSS_COMPILE}ar cq
QMAKE_RANLIB = $${CROSS_COMPILE}ranlib -s
QMAKE_NM = $${CROSS_COMPILE}nm -P