samples/native-lib: use the same shared lib name as product-mini (#1669)

Use the shared lib name `libiwasm` instead of static lib name `vmlib`
This commit is contained in:
YAMAMOTO Takashi 2022-11-01 22:55:43 +09:00 committed by GitHub
parent 94cecbe4cb
commit 825544ddab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,13 +54,14 @@ if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*
endif ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security")
# build out vmlib
# build out libiwasm
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
# Note: we build vmlib as a shared library here so that it can be
# Note: we build libiwasm as a shared library here so that it can be
# shared between iwasm and native libraries.
add_library(vmlib SHARED ${WAMR_RUNTIME_LIB_SOURCE})
add_library(libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE})
set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm)
################ wamr runtime ###################
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
@ -75,16 +76,16 @@ add_executable (iwasm ${RUNTIME_SOURCE_ALL})
check_pie_supported()
set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(iwasm vmlib -lpthread -lm -ldl)
target_link_libraries(iwasm libiwasm -lpthread -lm -ldl)
################ native libraries ###############
add_library (test_add SHARED test_add.c)
add_library (test_sqrt SHARED test_sqrt.c)
add_library (test_hello SHARED test_hello.c)
# Note: Unlike simpler examples above, test_hello2 directly uses
# the API provided by the vmlib library.
# the API provided by the libiwasm library.
add_library (test_hello2 SHARED test_hello2.c)
target_link_libraries(test_hello2 vmlib)
target_link_libraries(test_hello2 libiwasm)
################ wasm application ###############
add_subdirectory(wasm-app)