|
|
@@ -7,7 +7,9 @@ project (iwasm)
|
|
|
|
|
|
set (CMAKE_VERBOSE_MAKEFILE OFF)
|
|
|
|
|
|
-string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
|
|
|
+if (NOT DEFINED WAMR_BUILD_PLATFORM)
|
|
|
+ string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
|
|
|
+endif ()
|
|
|
|
|
|
# Reset default linker flags
|
|
|
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
|
|
@@ -135,23 +137,26 @@ include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
|
|
|
|
|
|
# STATIC LIBRARY
|
|
|
add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE})
|
|
|
+set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib)
|
|
|
+target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include)
|
|
|
+target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread)
|
|
|
if (WAMR_BUILD_WASM_CACHE EQUAL 1)
|
|
|
- target_link_libraries(iwasm_static PUBLIC boringssl_crypto)
|
|
|
+ target_link_libraries(iwasm_static INTERFACE boringssl_crypto)
|
|
|
endif ()
|
|
|
-set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib)
|
|
|
|
|
|
install (TARGETS iwasm_static ARCHIVE DESTINATION lib)
|
|
|
|
|
|
# SHARED LIBRARY
|
|
|
add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE})
|
|
|
set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm)
|
|
|
-target_link_libraries (iwasm_shared ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread)
|
|
|
+target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include)
|
|
|
+target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread)
|
|
|
if (WAMR_BUILD_WASM_CACHE EQUAL 1)
|
|
|
- target_link_libraries(iwasm_shared boringssl_crypto)
|
|
|
+ target_link_libraries(iwasm_shared INTERFACE boringssl_crypto)
|
|
|
endif ()
|
|
|
|
|
|
if (MINGW)
|
|
|
-target_link_libraries (iwasm_shared -lWs2_32)
|
|
|
+ target_link_libraries (iwasm_shared -lWs2_32)
|
|
|
endif ()
|
|
|
|
|
|
install (TARGETS iwasm_shared LIBRARY DESTINATION lib)
|