From 22e9ff9c164d9912fcbe7987f4d39e467b0a600f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 14 Jun 2018 15:54:37 +0300 Subject: mkspecs: Allow specifying a CROSS_COMPILE for mac/clang targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Morten Johan Sørvig --- mkspecs/common/clang.conf | 4 ++-- mkspecs/common/mac.conf | 8 ++++---- 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 -- cgit v1.2.3