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 rzr@users.sf.net
  • Loading branch information
rzr committed Aug 6, 2020
1 parent 31a6859 commit d7f7946
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 @@ -507,6 +507,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 @@ -563,7 +566,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 @@ -590,6 +599,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 d7f7946

Please sign in to comment.