mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
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:
parent
94cecbe4cb
commit
825544ddab
|
@ -54,13 +54,14 @@ if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*
|
||||||
endif ()
|
endif ()
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security")
|
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}/../..)
|
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
|
||||||
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
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.
|
# 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 ###################
|
################ wamr runtime ###################
|
||||||
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
|
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
|
||||||
|
@ -75,16 +76,16 @@ add_executable (iwasm ${RUNTIME_SOURCE_ALL})
|
||||||
check_pie_supported()
|
check_pie_supported()
|
||||||
set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
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 ###############
|
################ native libraries ###############
|
||||||
add_library (test_add SHARED test_add.c)
|
add_library (test_add SHARED test_add.c)
|
||||||
add_library (test_sqrt SHARED test_sqrt.c)
|
add_library (test_sqrt SHARED test_sqrt.c)
|
||||||
add_library (test_hello SHARED test_hello.c)
|
add_library (test_hello SHARED test_hello.c)
|
||||||
# Note: Unlike simpler examples above, test_hello2 directly uses
|
# 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)
|
add_library (test_hello2 SHARED test_hello2.c)
|
||||||
target_link_libraries(test_hello2 vmlib)
|
target_link_libraries(test_hello2 libiwasm)
|
||||||
|
|
||||||
################ wasm application ###############
|
################ wasm application ###############
|
||||||
add_subdirectory(wasm-app)
|
add_subdirectory(wasm-app)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user