Skip to content

Commit

Permalink
build: Install static lib
Browse files Browse the repository at this point in the history
This is useful for debian's iotjs-dev package

Change-Id: Ib9f6cb50631f4cdfeb308108f91ed28e7d204dc4
Forwarded: jerryscript-project#1948
Origin: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/cmake/lib/review/master
Bug: jerryscript-project#1945
Bug-Debian: https://bugs.debian.org/957364
Update: 2020-07-24
IoT.js-DCO-1.0-Signed-off-by: Philippe Coval [email protected]
  • Loading branch information
rzr committed Jul 24, 2020
1 parent c4478e2 commit 22a194e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ install(FILES ${IOTJS_PUBLIC_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR})

# Configure the libiotjs
set(TARGET_LIB_IOTJS libiotjs)
# Configure the libiotjs.a
set(TARGET_STATIC_IOTJS libiotjs)

if(CREATE_SHARED_LIB)
add_library(${TARGET_LIB_IOTJS} SHARED ${LIB_IOTJS_SRC})
else()
Expand Down Expand Up @@ -559,7 +562,13 @@ target_link_libraries(${TARGET_LIB_IOTJS}
${MBEDTLS_LIBS}
${EXTERNAL_LIBS}
)

target_link_libraries(${TARGET_STATIC_IOTJS}
${JERRY_LIBS}
${TUV_LIBS}
libhttp-parser
${MBEDTLS_LIBS}
${EXTERNAL_LIBS}
)
if("${LIB_INSTALL_DIR}" STREQUAL "")
set(LIB_INSTALL_DIR "lib")
endif()
Expand All @@ -586,6 +595,7 @@ if(NOT BUILD_LIB_ONLY)
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
LIBRARY DESTINATION "${INSTALL_PREFIX}/${LIB_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
install(TARGETS ${TARGET_LIB_IOTJS} DESTINATION ${LIB_INSTALL_DIR})
if(CREATE_SHARED_LIB)
install(TARGETS ${TARGET_LIB_IOTJS}
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
Expand Down

0 comments on commit 22a194e

Please sign in to comment.