From 22a194e1386ee939f4bf8f143f2cf20e5bef8e91 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 20 Jun 2019 14:08:55 +0200 Subject: [PATCH] build: Install static lib This is useful for debian's iotjs-dev package Change-Id: Ib9f6cb50631f4cdfeb308108f91ed28e7d204dc4 Forwarded: https://github.com/jerryscript-project/iotjs/pull/1948 Origin: https://github.com/TizenTeam/iotjs/tree/sandbox/rzr/cmake/lib/review/master Bug: https://github.com/jerryscript-project/iotjs/issues/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 --- cmake/iotjs.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/iotjs.cmake b/cmake/iotjs.cmake index 1b58179765..713054cc11 100644 --- a/cmake/iotjs.cmake +++ b/cmake/iotjs.cmake @@ -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() @@ -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() @@ -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}"