cmake: Remove -O3 from release CFLAGS. Honor the OpenWRT -Os flag instead.
[openwrt/staging/chunkeey.git] / include / cmake.mk
1 PKG_INSTALL:=1
2
3 define Build/Configure/Default
4 (cd $(PKG_BUILD_DIR); \
5 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
6 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
7 cmake \
8 -DCMAKE_SYSTEM_NAME=Linux \
9 -DCMAKE_SYSTEM_VERSION=1 \
10 -DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
11 -DCMAKE_BUILD_TYPE=Release \
12 -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
13 -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
14 -DCMAKE_C_COMPILER=$(TOOLCHAIN_DIR)/bin/$(TARGET_CC) \
15 -DCMAKE_CXX_COMPILER=$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX) \
16 -DCMAKE_EXE_LINKER_FLAGS="$(TARGET_LDFLAGS)" \
17 -DCMAKE_MODULE_LINKER_FLAGS="$(TARGET_LDFLAGS)" \
18 -DCMAKE_SHARED_LINKER_FLAGS="$(TARGET_LDFLAGS)" \
19 -DCMAKE_FIND_ROOT_PATH=$(STAGING_DIR) \
20 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=$(STAGING_DIR_HOST) \
21 -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=$(STAGING_DIR) \
22 -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=$(STAGING_DIR) \
23 -DCMAKE_STRIP=: \
24 -DCMAKE_INSTALL_PREFIX=/usr \
25 $(CMAKE_OPTIONS) \
26 . \
27 )
28 endef
29
30 define Build/InstallDev/cmake
31 $(INSTALL_DIR) $(1)
32 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
33 endef
34
35 Build/InstallDev = $(if $(CMAKE_INSTALL),$(Build/InstallDev/cmake))