diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-05-30 11:58:54 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-05-30 11:58:54 +0000 |
commit | ad7cb5fd62d725a07eb729becbf7d02829feac2d (patch) | |
tree | a04962cbe379b8f9d06934493c9cb7f208647d4c | |
parent | a8c6710940ac8b64e36750a477b95dc248d90743 (diff) | |
download | master-187ad058-ad7cb5fd62d725a07eb729becbf7d02829feac2d.tar.gz master-187ad058-ad7cb5fd62d725a07eb729becbf7d02829feac2d.tar.bz2 master-187ad058-ad7cb5fd62d725a07eb729becbf7d02829feac2d.zip |
include/cmake.mk: define CMAKE_AR and CMAKE_RANLIB to fix build errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40885 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | include/cmake.mk | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/cmake.mk b/include/cmake.mk index a2ac62fcae..23ac56c377 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -6,18 +6,17 @@ endif CMAKE_SOURCE_DIR:=. +ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) + cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1) +else + cmake_tool=$(shell which $(1)) +endif + 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:= - else - CMAKE_C_COMPILER:=$(shell which $(TARGET_CC)) - CMAKE_C_COMPILER_ARG1:= - CMAKE_CXX_COMPILER:=$(shell which $(TARGET_CXX)) - CMAKE_CXX_COMPILER_ARG1:= - endif + 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 \ |