Skip to content

Commit

Permalink
build: Install static lib
Browse files Browse the repository at this point in the history
Add extra install step for installing lib along headers (Fixes: jerryscript-project#1896).

Also remove headers, lib when installing executable.

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
Relate-to: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/cmake/lib/review/master
Last-Update: 2020-10-15
IoT.js-DCO-1.0-Signed-off-by: Philippe Coval [email protected]
  • Loading branch information
rzr committed Oct 15, 2020
1 parent 7fdafb0 commit 2b7a1cd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cmake/iotjs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,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 @@ -557,7 +560,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 @@ -581,12 +590,12 @@ if(NOT BUILD_LIB_ONLY)
target_include_directories(${TARGET_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
target_link_libraries(${TARGET_IOTJS} ${TARGET_LIB_IOTJS})
install(TARGETS ${TARGET_IOTJS}
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin")
install(TARGETS ${TARGET_LIB_IOTJS}
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
if(CREATE_SHARED_LIB)
install(TARGETS ${TARGET_LIB_IOTJS}
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
endif()
Expand Down

0 comments on commit 2b7a1cd

Please sign in to comment.