aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-04-06 19:37:42 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-04-06 19:37:42 +0000
commita8aab06962e56610906b0a86341034c2b40360bd (patch)
tree383df6f0185cec46c7d51366237f85c7934f5b78 /include
parentd1212499c8924d637b86f8559de72cd7c2d02590 (diff)
downloadupstream-a8aab06962e56610906b0a86341034c2b40360bd.tar.gz
upstream-a8aab06962e56610906b0a86341034c2b40360bd.tar.bz2
upstream-a8aab06962e56610906b0a86341034c2b40360bd.zip
cmake.mk: add host build support
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45282 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/cmake.mk26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/cmake.mk b/include/cmake.mk
index 49fba26278..f1db612986 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -32,6 +32,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR);$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
+CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR_HOST)
define Build/Configure/Default
(cd $(PKG_BUILD_DIR); \
@@ -77,3 +78,28 @@ define Build/InstallDev/cmake
endef
Build/InstallDev = $(if $(CMAKE_INSTALL),$(Build/InstallDev/cmake))
+
+define Host/Configure/Default
+ (cd $(HOST_BUILD_DIR); \
+ CFLAGS="$(HOST_CFLAGS)" \
+ CXXFLAGS="$(HOST_CFLAGS)" \
+ LDFLAGS="$(HOST_LDFLAGS)" \
+ cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
+ -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
+ -DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
+ -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
+ -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
+ -DCMAKE_FIND_ROOT_PATH="$(CMAKE_HOST_FIND_ROOT_PATH)" \
+ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
+ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
+ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
+ -DCMAKE_STRIP=: \
+ -DCMAKE_INSTALL_PREFIX=$(STAGING_DIR_HOST) \
+ -DCMAKE_PREFIX_PATH=$(STAGING_DIR_HOST) \
+ -DCMAKE_SKIP_RPATH=TRUE \
+ $(CMAKE_HOST_OPTIONS) \
+ $(CMAKE_SOURCE_DIR) \
+ )
+endef