projects
/
librecmc
/
librecmc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kernel: make the kernel build auto-clean the build dir like package builds
[librecmc/librecmc.git]
/
include
/
cmake.mk
diff --git
a/include/cmake.mk
b/include/cmake.mk
index 009c6c27728e52eec7131952149232bfa7e60168..483a1510827b7496f53202ef615c71708c29de5c 100644
(file)
--- a/
include/cmake.mk
+++ b/
include/cmake.mk
@@
-6,7
+6,10
@@
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
MAKE_FLAGS+=VERBOSE=1
endif
MAKE_FLAGS+=VERBOSE=1
endif
-CMAKE_SOURCE_DIR:=.
+CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
+CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)
+HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)
+MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1)
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1)
@@
-35,7
+38,8
@@
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOST)
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
define Build/Configure/Default
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
define Build/Configure/Default
- (cd $(PKG_BUILD_DIR); \
+ mkdir -p $(CMAKE_BINARY_DIR)
+ (cd $(CMAKE_BINARY_DIR); \
CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
@@
-100,6
+104,6
@@
define Host/Configure/Default
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE \
$(CMAKE_HOST_OPTIONS) \
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE \
$(CMAKE_HOST_OPTIONS) \
- $(CMAKE_SOURCE_DIR) \
+ $(
HOST_
CMAKE_SOURCE_DIR) \
)
endef
)
endef