Skip to content

Commit 2b7a1cd

Browse files
committed
build: Install static lib
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]
1 parent 7fdafb0 commit 2b7a1cd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cmake/iotjs.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ set(IOTJS_PUBLIC_HEADERS
501501

502502
# Configure the libiotjs
503503
set(TARGET_LIB_IOTJS libiotjs)
504+
# Configure the libiotjs.a
505+
set(TARGET_STATIC_IOTJS libiotjs)
506+
504507
if(CREATE_SHARED_LIB)
505508
add_library(${TARGET_LIB_IOTJS} SHARED ${LIB_IOTJS_SRC})
506509
else()
@@ -557,7 +560,13 @@ target_link_libraries(${TARGET_LIB_IOTJS}
557560
${MBEDTLS_LIBS}
558561
${EXTERNAL_LIBS}
559562
)
560-
563+
target_link_libraries(${TARGET_STATIC_IOTJS}
564+
${JERRY_LIBS}
565+
${TUV_LIBS}
566+
libhttp-parser
567+
${MBEDTLS_LIBS}
568+
${EXTERNAL_LIBS}
569+
)
561570
if("${LIB_INSTALL_DIR}" STREQUAL "")
562571
set(LIB_INSTALL_DIR "lib")
563572
endif()
@@ -581,12 +590,12 @@ if(NOT BUILD_LIB_ONLY)
581590
target_include_directories(${TARGET_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
582591
target_link_libraries(${TARGET_IOTJS} ${TARGET_LIB_IOTJS})
583592
install(TARGETS ${TARGET_IOTJS}
584-
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
593+
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin")
594+
install(TARGETS ${TARGET_LIB_IOTJS}
585595
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
586596
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
587597
if(CREATE_SHARED_LIB)
588598
install(TARGETS ${TARGET_LIB_IOTJS}
589-
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
590599
LIBRARY DESTINATION "${INSTALL_PREFIX}/lib"
591600
PUBLIC_HEADER DESTINATION "${INSTALL_PREFIX}/include/iotjs")
592601
endif()

0 commit comments

Comments
 (0)