include/cmake.mk: define CMAKE_AR and CMAKE_RANLIB to fix build errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40885
This commit is contained in:
parent
72d6a51e64
commit
0e9245c19f
1 changed files with 14 additions and 11 deletions
|
@ -6,18 +6,17 @@ endif
|
|||
|
||||
CMAKE_SOURCE_DIR:=.
|
||||
|
||||
ifeq ($(CONFIG_CCACHE),)
|
||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||
CMAKE_C_COMPILER:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)
|
||||
CMAKE_C_COMPILER_ARG1:=
|
||||
CMAKE_CXX_COMPILER:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)
|
||||
CMAKE_CXX_COMPILER_ARG1:=
|
||||
cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1)
|
||||
else
|
||||
CMAKE_C_COMPILER:=$(shell which $(TARGET_CC))
|
||||
CMAKE_C_COMPILER_ARG1:=
|
||||
CMAKE_CXX_COMPILER:=$(shell which $(TARGET_CXX))
|
||||
CMAKE_CXX_COMPILER_ARG1:=
|
||||
cmake_tool=$(shell which $(1))
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CCACHE),)
|
||||
CMAKE_C_COMPILER:=$(call cmake_tool,$(TARGET_CC))
|
||||
CMAKE_CXX_COMPILER:=$(call cmake_tool,$(TARGET_CXX))
|
||||
CMAKE_C_COMPILER_ARG1:=
|
||||
CMAKE_CXX_COMPILER_ARG1:=
|
||||
else
|
||||
CCACHE:=$(shell which ccache)
|
||||
ifeq ($(CCACHE),)
|
||||
|
@ -28,6 +27,8 @@ else
|
|||
CMAKE_CXX_COMPILER:=$(CCACHE)
|
||||
CMAKE_CXX_COMPILER_ARG1:=$(TARGET_CXX_NOCACHE)
|
||||
endif
|
||||
CMAKE_AR:=$(call cmake_tool,$(TARGET_CROSS)ar)
|
||||
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_CROSS)ranlib)
|
||||
|
||||
define Build/Configure/Default
|
||||
(cd $(PKG_BUILD_DIR); \
|
||||
|
@ -48,6 +49,8 @@ define Build/Configure/Default
|
|||
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
|
||||
-DCMAKE_AR="$(CMAKE_AR)" \
|
||||
-DCMAKE_RANLIB="$(CMAKE_RANLIB)" \
|
||||
-DCMAKE_FIND_ROOT_PATH="$(STAGING_DIR);$(TOOLCHAIN_DIR)" \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
|
|
Loading…
Reference in a new issue