aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu MORIKAWA <morikw2@gmail.com>2020-12-21 13:49:40 +0900
committerHans Dedecker <dedeckeh@gmail.com>2020-12-21 19:53:10 +0100
commitd6cb50c7ba8447f018139401d0d3821069e5f389 (patch)
treef13be30dd5c85715b3f2af88400a04253fbff8bf
parent20d847d1338f716fc9f143f633b6f79ba6017b5c (diff)
downloadupstream-d6cb50c7ba8447f018139401d0d3821069e5f389.tar.gz
upstream-d6cb50c7ba8447f018139401d0d3821069e5f389.tar.bz2
upstream-d6cb50c7ba8447f018139401d0d3821069e5f389.zip
include/cmake.mk: Fix the bug in ccache support
Fix the bug in ccache support due to this change. https://github.com/openwrt/openwrt/commit/bfc433efd4a0c6875a92981d1bd2a5e3e60c61c6 The new cmake uses this for the wrapper. https://cmake.org/cmake/help/v3.19/prop_tgt/LANG_COMPILER_LAUNCHER.html Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
-rw-r--r--include/cmake.mk32
1 files changed, 14 insertions, 18 deletions
diff --git a/include/cmake.mk b/include/cmake.mk
index 0a20530a16..96c4d7df34 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -19,26 +19,22 @@ else
endif
ifeq ($(CONFIG_CCACHE),)
+ CMAKE_C_COMPILER_LAUNCHER:=
+ CMAKE_CXX_COMPILER_LAUNCHER:=
CMAKE_C_COMPILER:=$(call cmake_tool,$(TARGET_CC))
CMAKE_CXX_COMPILER:=$(call cmake_tool,$(TARGET_CXX))
- CMAKE_C_COMPILER_ARG1:=
- CMAKE_CXX_COMPILER_ARG1:=
CMAKE_HOST_C_COMPILER:=$(HOSTCC)
CMAKE_HOST_CXX_COMPILER:=$(HOSTCXX)
- CMAKE_HOST_C_COMPILER_ARG1:=
- CMAKE_HOST_CXX_COMPILER_ARG1:=
else
CCACHE:=$(STAGING_DIR_HOST)/bin/ccache
- CMAKE_C_COMPILER:=$(CCACHE)
- CMAKE_C_COMPILER_ARG1:=$(TARGET_CC_NOCACHE)
- CMAKE_CXX_COMPILER:=$(CCACHE)
- CMAKE_CXX_COMPILER_ARG1:=$(TARGET_CXX_NOCACHE)
+ CMAKE_C_COMPILER_LAUNCHER:=$(CCACHE)
+ CMAKE_CXX_COMPILER_LAUNCHER:=$(CCACHE)
+ CMAKE_C_COMPILER:=$(TARGET_CC_NOCACHE)
+ CMAKE_CXX_COMPILER:=$(TARGET_CXX_NOCACHE)
- CMAKE_HOST_C_COMPILER:=$(CCACHE)
- CMAKE_HOST_C_COMPILER_ARG1:=$(HOSTCC_NOCACHE)
- CMAKE_HOST_CXX_COMPILER:=$(CCACHE)
- CMAKE_HOST_CXX_COMPILER_ARG1:=$(HOSTCXX_NOCACHE)
+ CMAKE_HOST_C_COMPILER:=$(HOSTCC_NOCACHE)
+ CMAKE_HOST_CXX_COMPILER:=$(HOSTCXX_NOCACHE)
endif
CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
@@ -61,12 +57,12 @@ define Build/Configure/Default
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
+ -DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
-DCMAKE_C_COMPILER="$(CMAKE_C_COMPILER)" \
- -DCMAKE_C_COMPILER_ARG1="$(CMAKE_C_COMPILER_ARG1)" \
+ -DCMAKE_CXX_COMPILER_LAUNCHER="$(CMAKE_CXX_COMPILER_LAUNCHER)" \
-DCMAKE_CXX_COMPILER="$(CMAKE_CXX_COMPILER)" \
- -DCMAKE_CXX_COMPILER_ARG1="$(CMAKE_CXX_COMPILER_ARG1)" \
+ -DCMAKE_ASM_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
-DCMAKE_ASM_COMPILER="$(CMAKE_C_COMPILER)" \
- -DCMAKE_ASM_COMPILER_ARG1="$(CMAKE_C_COMPILER_ARG1)" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
-DCMAKE_MODULE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS) $(CMAKE_SHARED_LDFLAGS)" \
-DCMAKE_SHARED_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS) $(CMAKE_SHARED_LDFLAGS)" \
@@ -107,12 +103,12 @@ define Host/Configure/Default
LDFLAGS="$(HOST_LDFLAGS)" \
cmake \
-DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
-DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
- -DCMAKE_C_COMPILER_ARG1="$(CMAKE_HOST_C_COMPILER_ARG1)" \
+ -DCMAKE_CXX_COMPILER_LAUNCHER="$(CMAKE_CXX_COMPILER_LAUNCHER)" \
-DCMAKE_CXX_COMPILER="$(CMAKE_HOST_CXX_COMPILER)" \
- -DCMAKE_CXX_COMPILER_ARG1="$(CMAKE_HOST_CXX_COMPILER_ARG1)" \
+ -DCMAKE_ASM_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \
-DCMAKE_ASM_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
- -DCMAKE_ASM_COMPILER_ARG1="$(CMAKE_HOST_C_COMPILER_ARG1)" \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \