Skip to content

Commit

Permalink
fix cmake and shadow-node build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie committed Dec 2, 2019
1 parent 38a0b22 commit b363e0c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions deps/shadow-node/cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ set(JS2C_DEPENDS

if(EXTERNAL_SNAPSHOT_TOOL)
set(JS2C_SNAPSHOT_ARG --snapshot-tool=${EXTERNAL_SNAPSHOT_TOOL})
iotjs_add_compile_flags(-DENABLE_SNAPSHOT)
elseif(ENABLE_SNAPSHOT)
set(JS2C_SNAPSHOT_ARG --snapshot-tool=${JERRY_HOST_SNAPSHOT})
list(APPEND JS2C_DEPENDS jerry-snapshot)
Expand Down
6 changes: 2 additions & 4 deletions openwrt/include/cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ define Build/Configure/Default
CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
cmake \
cmake $(CMAKE_SOURCE_DIR) \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_VERSION=1 \
-DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
Expand Down Expand Up @@ -70,7 +70,6 @@ define Build/Configure/Default
-DCMAKE_PREFIX_PATH=$(STAGING_DIR) \
-DCMAKE_SKIP_RPATH=TRUE \
$(CMAKE_OPTIONS) \
$(CMAKE_SOURCE_DIR) \
)
endef

Expand All @@ -86,7 +85,7 @@ define Host/Configure/Default
CFLAGS="$(HOST_CFLAGS)" \
CXXFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
cmake \
cmake $(CMAKE_SOURCE_DIR) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
Expand All @@ -102,6 +101,5 @@ define Host/Configure/Default
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE \
$(CMAKE_HOST_OPTIONS) \
$(CMAKE_SOURCE_DIR) \
)
endef
22 changes: 15 additions & 7 deletions openwrt/package/yodaos/shadow-node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ SHADOW_NODE_TARGET_ARCH:=$(shell echo ${CONFIG_ARCH})
SHADOW_NODE_TARGET_BOARD:=$(shell echo ${CONFIG_TARGET_BOARD})

CMAKE_HOST_OPTIONS += \
-B$(HOST_BUILD_DIR)/out \
-H$(HOST_BUILD_DIR) \
-DTARGET_ARCH=$(HOST_ARCH) \
-DTARGET_OS=$(HOST_OS) \
-DTARGET_BOARD=None \
Expand All @@ -35,6 +37,8 @@ CMAKE_HOST_OPTIONS += \
-DINSTALL_PREFIX='$(STAGING_DIR_HOSTPKG)/usr'

CMAKE_OPTIONS += \
-B$(PKG_BUILD_DIR)/out \
-H$(PKG_BUILD_DIR) \
-DTARGET_ARCH=$(CONFIG_ARCH) \
-DTARGET_OS=linux \
-DTARGET_BOARD=$(SHADOW_NODE_TARGET_BOARD) \
Expand All @@ -56,16 +60,26 @@ CMAKE_OPTIONS += \
-DEXTERNAL_COMPILE_FLAGS='' \
-DEXTERNAL_LINKER_FLAGS='' \
-DEXTERNAL_INCLUDE_DIR='' \
-DEXTERNAL_SNAPSHOT_TOOL='$(HOST_BUILD_DIR)/usr/bin/jerry-snapshot' \
-DEXTERNAL_SNAPSHOT_TOOL='$(HOST_BUILD_DIR)/out/deps/jerry-host/bin/jerry-snapshot' \
-DINSTALL_PREFIX='/usr'

HOST_MAKE_FLAGS += -C $(HOST_BUILD_DIR)/out
MAKE_FLAGS += -C $(PKG_BUILD_DIR)/out

define Package/shadow-node
SECTION:=libs
CATEGORY:=rokid
TITLE:=shadow-node
DEPENDS:=+libstdcpp +dbus +zlib +librt
endef

define Host/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(HOST_BUILD_DIR)
$(RM) $(HOST_BUILD_DIR)/deps/jerry/jerry-core/include/jerryscript-snapshot.h.rej
$(RM) $(HOST_BUILD_DIR)/deps/jerry/tests/unit-core/test-snapshot.c.rej
$(call Host/Prepare/Default,)
endef

define Build/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(PKG_BUILD_DIR)
$(RM) $(PKG_BUILD_DIR)/deps/jerry/jerry-core/include/jerryscript-snapshot.h.rej
Expand Down Expand Up @@ -95,12 +109,6 @@ define Package/shadow-node/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/iotjs $(1)/usr/bin/node
endef

define Host/Prepare
$(CP) $(PKG_SOURCE_DIR)/* $(HOST_BUILD_DIR)
$(RM) $(HOST_BUILD_DIR)/deps/jerry/jerry-core/include/jerryscript-snapshot.h.rej
$(RM) $(HOST_BUILD_DIR)/deps/jerry/tests/unit-core/test-snapshot.c.rej
$(call Host/Prepare/Default,)
endef

$(eval $(call BuildPackage,shadow-node))
$(eval $(call HostBuild))

0 comments on commit b363e0c

Please sign in to comment.