Skip to content

Commit

Permalink
shadow-node host building is done
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie committed Nov 22, 2019
1 parent b7a46c7 commit a3fe57d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
5 changes: 2 additions & 3 deletions deps/shadow-node/cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ add_dependencies(${TARGET_LIB_IOTJS}
${TUV_LIBS}
libhttp-parser
${MBEDTLS_LIBS}
${MQTT_LIBS}
libmqtt_packet
)
add_definitions(
-DNODE_MAJOR_VERSION=${IOTJS_VERSION_MAJOR}
Expand All @@ -453,8 +453,7 @@ target_link_libraries(${TARGET_LIB_IOTJS}
${TUV_LIBS}
libhttp-parser
${MBEDTLS_LIBS}
${MQTT_LIBS}
${DBUS_LIBRARY_DIRS}
libmqtt_packet
${EXTERNAL_LIBS}
)

Expand Down
4 changes: 2 additions & 2 deletions deps/shadow-node/cmake/libmqtt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cmake_minimum_required(VERSION 2.8)

set(DEPS_MQTT deps/libmqtt)
set(DEPS_MQTT_SRC ${ROOT_DIR}/${DEPS_MQTT})
set(DEPS_MQTT_SRC ${ROOT_DIR}/${DEPS_MQTT}/)

ExternalProject_Add(libmqtt
PREFIX ${DEPS_MQTT}
Expand All @@ -33,7 +33,7 @@ ExternalProject_Add(libmqtt
)

add_library(libmqtt_packet STATIC IMPORTED)
add_dependencies(libmqtt_packet mqtt_packet)
add_dependencies(libmqtt_packet libmqtt)
set_property(TARGET libmqtt_packet PROPERTY
IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libmqtt_packet.a)
set_property(DIRECTORY APPEND PROPERTY
Expand Down
2 changes: 2 additions & 0 deletions deps/shadow-node/cmake/libtuv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ExternalProject_Add(libtuv
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DTARGET_ARCH=${TARGET_ARCH}
-DTARGET_OS=${TARGET_OS}
-DLIBTUV_CUSTOM_LIB_OUT=lib
-DBUILDTESTER=NO
-DBUILDAPIEMULTESTER=NO
Expand Down
8 changes: 5 additions & 3 deletions deps/shadow-node/deps/libtuv/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ endif()

# path for platform depends files, use full name for default
# (e.g, i686-linux)
if (DEFINED TARGET_PLATFORM)
set(TUV_PLATFORM_PATH ${TARGET_PLATFORM})
include("cmake/option/option_${TARGET_PLATFORM}.cmake")
if (DEFINED TARGET_OS AND DEFINED TARGET_ARCH)
string(TOLOWER "${TARGET_ARCH}-${TARGET_OS}" TARGET_PLATFORM_L)
message(">>### ${TARGET_PLATFORM_L} <<")
set(TUV_PLATFORM_PATH "${TARGET_PLATFORM_L}")
include("cmake/option/option_${TARGET_PLATFORM_L}.cmake")
endif()

string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_L)
Expand Down
12 changes: 9 additions & 3 deletions openwrt/package/yodaos/shadow-node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ CMAKE_HOST_OPTIONS += \
-DFEATURE_PROFILE='$(SHADOW_NODE_SOURCE)/deps/jerry/jerry-core/profiles/es5.1.profile' \
-DENABLE_LTO=OFF \
-DENABLE_SNAPSHOT=ON \
-DENABLE_NAPI=OFF \
-DENABLE_JERRYX=OFF \
-DENABLE_NAPI=ON \
-DENABLE_JERRYX=ON \
-DBUILD_LIB_ONLY=OFF \
-DINSTALL_PREFIX='/usr'
-DINSTALL_PREFIX='$(STAGING_DIR_HOSTPKG)/usr'

CMAKE_OPTIONS += \
-DTARGET_ARCH=$(CONFIG_ARCH) \
Expand Down Expand Up @@ -72,6 +72,12 @@ define Build/Prepare
$(call Build/Prepare/Default,)
endef

define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/usr/bin
$(call $(Host/Install/Default,))
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
Expand Down

0 comments on commit a3fe57d

Please sign in to comment.