Skip to content

Commit

Permalink
Add BUILD_BYPRODUCTS to ExternalProject_Add for building with Ninja
Browse files Browse the repository at this point in the history
IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
  • Loading branch information
lygstate committed Jan 30, 2021
1 parent 7fdafb0 commit 2d4df99
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmake/http-parser.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ExternalProject_Add(http-parser
-DOS=${TARGET_OS}
${HTTPPARSER_NUTTX_ARG}
-DENABLE_MEMORY_CONSTRAINTS=ON
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/lib/${HTTPPARSER_NAME}
)
add_library(libhttp-parser STATIC IMPORTED)
add_dependencies(libhttp-parser http-parser)
Expand Down
28 changes: 24 additions & 4 deletions cmake/jerry.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ cmake_minimum_required(VERSION 2.8)

# Host jerry for snapshot generation
set(DEPS_HOST_JERRY deps/jerry-host)

set(JERRY_HOST_SNAPSHOT
${CMAKE_BINARY_DIR}/${DEPS_HOST_JERRY}/bin/jerry-snapshot)

set(JERRY_HOST_BUILD_BYPRODUCTS
${JERRY_HOST_SNAPSHOT}
)

ExternalProject_Add(hostjerry
PREFIX ${DEPS_HOST_JERRY}
SOURCE_DIR ${ROOT_DIR}/deps/jerry/
Expand Down Expand Up @@ -45,9 +53,8 @@ ExternalProject_Add(hostjerry
# can not be represented correctly in the JerryScript engine
# currently.
-DJERRY_SYSTEM_ALLOCATOR=OFF
BUILD_BYPRODUCTS ${JERRY_HOST_BUILD_BYPRODUCTS}
)
set(JERRY_HOST_SNAPSHOT
${CMAKE_BINARY_DIR}/${DEPS_HOST_JERRY}/bin/jerry-snapshot)
add_executable(jerry-snapshot IMPORTED)
add_dependencies(jerry-snapshot hostjerry)
set_property(TARGET jerry-snapshot PROPERTY
Expand Down Expand Up @@ -118,6 +125,20 @@ separate_arguments(EXTRA_JERRY_CMAKE_PARAMS)
build_lib_name(JERRY_CORE_NAME jerry-core)
build_lib_name(JERRY_LIBM_NAME jerry-libm)
build_lib_name(JERRY_EXT_NAME jerry-ext)
build_lib_name(JERRY_PORT_NAME jerry-port)
build_lib_name(JERRY_PORT_DEFAULT_NAME jerry-port-default)

set(JERRY_BUILD_BYPRODUCTS
${CMAKE_BINARY_DIR}/lib/${JERRY_CORE_NAME}
${CMAKE_BINARY_DIR}/lib/${JERRY_LIBM_NAME}
${CMAKE_BINARY_DIR}/lib/${JERRY_EXT_NAME}
)

if(NOT "${TARGET_OS}" MATCHES "NUTTX|TIZENRT")
list(APPEND JERRY_BUILD_BYPRODUCTS
${CMAKE_BINARY_DIR}/lib/${JERRY_PORT_DEFAULT_NAME})
endif()


set(DEPS_LIB_JERRY deps/jerry)
set(DEPS_LIB_JERRY_SRC ${ROOT_DIR}/${DEPS_LIB_JERRY})
Expand Down Expand Up @@ -146,6 +167,7 @@ ExternalProject_Add(libjerry
-DENABLE_LTO=${ENABLE_LTO}
${DEPS_LIB_JERRY_ARGS}
${EXTRA_JERRY_CMAKE_PARAMS}
BUILD_BYPRODUCTS ${JERRY_BUILD_BYPRODUCTS}
)

set_property(DIRECTORY APPEND PROPERTY
Expand Down Expand Up @@ -174,8 +196,6 @@ set_property(TARGET jerry-ext PROPERTY
IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/${JERRY_EXT_NAME})

if(NOT "${TARGET_OS}" MATCHES "NUTTX|TIZENRT")
build_lib_name(JERRY_PORT_NAME jerry-port)
build_lib_name(JERRY_PORT_DEFAULT_NAME jerry-port-default)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/lib/${JERRY_PORT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion cmake/libtuv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ ExternalProject_Add(libtuv
-DBUILDAPIEMULTESTER=NO
-DTARGET_SYSTEMROOT=${TARGET_SYSTEMROOT}
-DTARGET_BOARD=${TARGET_BOARD}
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/lib/${LIBTUV_NAME}
)
add_library(tuv STATIC IMPORTED)
add_dependencies(tuv libtuv)
set_property(TARGET tuv PROPERTY
IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/${LIBTUV_NAME})
set_property(DIRECTORY APPEND PROPERTY
Expand Down

0 comments on commit 2d4df99

Please sign in to comment.