summaryrefslogtreecommitdiff
path: root/package/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'package/Makefile.in')
-rw-r--r--package/Makefile.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/Makefile.in b/package/Makefile.in
index 644eb1f47..599f68494 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -143,6 +143,14 @@ TARGET_CC := $(CCACHE) $(TARGET_CC)
TARGET_CXX := $(CCACHE) $(TARGET_CXX)
endif
+# * CMake doesn't support having the --sysroot option directly in the
+# compiler path, so move this option to CFLAGS/CXXFLAGS variables.
+# * Don't use ccache because then CMake will fail to detect compiler.
+CMAKE_TARGET_CC = $(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
+CMAKE_TARGET_CXX = $(filter-out --sysroot=%,$(TARGET_CXX_NOCCACHE))
+CMAKE_TARGET_CFLAGS = $(filter --sysroot=%,$(TARGET_CC_NOCCACHE)) $(TARGET_CFLAGS)
+CMAKE_TARGET_CXXFLAGS = $(filter --sysroot=%,$(TARGET_CXX_NOCCACHE)) $(TARGET_CXXFLAGS)
+
ifeq ($(BR2_STRIP_strip),y)
STRIP_DISCARD_ALL:=--discard-all
STRIP_STRIP_UNNEEDED:=--strip-unneeded