diff --git a/cmake/iotjs.cmake b/cmake/iotjs.cmake index 2216f12e4c..49f88e6895 100644 --- a/cmake/iotjs.cmake +++ b/cmake/iotjs.cmake @@ -501,6 +501,10 @@ 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() @@ -558,6 +562,13 @@ target_link_libraries(${TARGET_LIB_IOTJS} ${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() @@ -581,12 +592,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()