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: https://github.com/jerryscript-project/iotjs/pull/rzr
Origin: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/cmake/lib/review/master
Bug: #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 4ec6746 commit bbadd02
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 @@ -497,6 +497,9 @@ set(IOTJS_PUBLIC_HEADERS

# 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 @@ -553,7 +556,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 @@ -580,6 +589,7 @@ if(NOT BUILD_LIB_ONLY)
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
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 "${INSTALL_PREFIX}/bin"
Expand Down

0 comments on commit bbadd02

Please sign in to comment.