mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-01-20 05:40:50 +00:00
cmake.mk,rules.mk: fix host builds using CMake and ccache
Commitf98878e4c1
("cmake.mk: set C/CXX compiler for host builds as well") has introduced regression as it didn't taken usage of ccache into the account so fix it by handling ccache use cases as well. In order to get this working we need to export HOSTCXX_NOCACHE in rules.mk as well. Fixes:f98878e4c1
("cmake.mk: set C/CXX compiler for host builds as well") Reported-by: Ansuel Smith <ansuelsmth@gmail.com> Tested-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
parent
c7778acf10
commit
524fb5646e
@ -23,12 +23,22 @@ ifeq ($(CONFIG_CCACHE),)
|
|||||||
CMAKE_CXX_COMPILER:=$(call cmake_tool,$(TARGET_CXX))
|
CMAKE_CXX_COMPILER:=$(call cmake_tool,$(TARGET_CXX))
|
||||||
CMAKE_C_COMPILER_ARG1:=
|
CMAKE_C_COMPILER_ARG1:=
|
||||||
CMAKE_CXX_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
|
else
|
||||||
CCACHE:=$(STAGING_DIR_HOST)/bin/ccache
|
CCACHE:=$(STAGING_DIR_HOST)/bin/ccache
|
||||||
CMAKE_C_COMPILER:=$(CCACHE)
|
CMAKE_C_COMPILER:=$(CCACHE)
|
||||||
CMAKE_C_COMPILER_ARG1:=$(TARGET_CC_NOCACHE)
|
CMAKE_C_COMPILER_ARG1:=$(TARGET_CC_NOCACHE)
|
||||||
CMAKE_CXX_COMPILER:=$(CCACHE)
|
CMAKE_CXX_COMPILER:=$(CCACHE)
|
||||||
CMAKE_CXX_COMPILER_ARG1:=$(TARGET_CXX_NOCACHE)
|
CMAKE_CXX_COMPILER_ARG1:=$(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)
|
||||||
endif
|
endif
|
||||||
CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
|
CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
|
||||||
CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
|
CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
|
||||||
@ -97,8 +107,12 @@ define Host/Configure/Default
|
|||||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||||
cmake \
|
cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_C_COMPILER="$(HOSTCC)" \
|
-DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
|
||||||
-DCMAKE_CXX_COMPILER="$(HOSTCXX)" \
|
-DCMAKE_C_COMPILER_ARG1="$(CMAKE_HOST_C_COMPILER_ARG1)" \
|
||||||
|
-DCMAKE_CXX_COMPILER="$(CMAKE_HOST_CXX_COMPILER)" \
|
||||||
|
-DCMAKE_CXX_COMPILER_ARG1="$(CMAKE_HOST_CXX_COMPILER_ARG1)" \
|
||||||
|
-DCMAKE_ASM_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
|
||||||
|
-DCMAKE_ASM_COMPILER_ARG1="$(CMAKE_HOST_C_COMPILER_ARG1)" \
|
||||||
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
|
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
|
||||||
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
|
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
|
||||||
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
|
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
|
||||||
|
1
rules.mk
1
rules.mk
@ -292,6 +292,7 @@ HOSTCXX_NOCACHE:=$(HOSTCXX)
|
|||||||
export TARGET_CC_NOCACHE
|
export TARGET_CC_NOCACHE
|
||||||
export TARGET_CXX_NOCACHE
|
export TARGET_CXX_NOCACHE
|
||||||
export HOSTCC_NOCACHE
|
export HOSTCC_NOCACHE
|
||||||
|
export HOSTCXX_NOCACHE
|
||||||
|
|
||||||
ifneq ($(CONFIG_CCACHE),)
|
ifneq ($(CONFIG_CCACHE),)
|
||||||
TARGET_CC:= ccache_cc
|
TARGET_CC:= ccache_cc
|
||||||
|
Loading…
Reference in New Issue
Block a user