summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-06-14 15:54:37 +0300
committerMartin Storsjö <martin@martin.st>2018-06-21 11:55:20 +0000
commit22e9ff9c164d9912fcbe7987f4d39e467b0a600f (patch)
tree1b3bbf793df31972c52d23a6ba2acaf97df57c2f /mkspecs
parent5a68ce07bd32eeb86ea1b0141c3a4fe20acc86a8 (diff)
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>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/clang.conf4
-rw-r--r--mkspecs/common/mac.conf8
2 files changed, 6 insertions, 6 deletions
diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf
index e003b947aa..0fb84bc1b3 100644
--- a/mkspecs/common/clang.conf
+++ b/mkspecs/common/clang.conf
@@ -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
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index d5e559ee12..61bea952b2 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -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