Skip to content

Commit 3580d1a

Browse files
authored
Enable runtime API exposure for MSVC builds (#4287)
1 parent 3ab9f84 commit 3580d1a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
152152
set (THREADS_PREFER_PTHREAD_FLAG ON)
153153
find_package(Threads REQUIRED)
154154

155-
if (MSVC)
156-
add_definitions(-DCOMPILING_WASM_RUNTIME_API=1)
157-
endif ()
158-
159155
add_library (vmlib ${WAMR_RUNTIME_LIB_SOURCE})
160156
set_target_properties (vmlib PROPERTIES OUTPUT_NAME iwasm)
161157
target_include_directories(vmlib INTERFACE

build-scripts/runtime_lib.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ else()
193193
enable_language (ASM)
194194
endif()
195195

196+
# it will expose the runtime APIs.
197+
# you'll use the following command to check the exported APIs
198+
# dumpbin.exe /EXPORTS xxx
199+
if (MSVC)
200+
add_compile_definitions(COMPILING_WASM_RUNTIME_API=1)
201+
endif ()
202+
196203
include (${SHARED_PLATFORM_CONFIG})
197204
include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
198205
include (${IWASM_DIR}/common/iwasm_common.cmake)

product-mini/platforms/windows/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
1616

1717
set(CMAKE_CXX_STANDARD 17)
1818

19-
add_definitions(-DCOMPILING_WASM_RUNTIME_API=1)
20-
2119
# Set WAMR_BUILD_TARGET, currently values supported:
2220
# "X86_64", "AMD_64", "X86_32", "AARCH64[sub]", "ARM[sub]", "THUMB[sub]", "MIPS", "XTENSA"
2321
if (NOT DEFINED WAMR_BUILD_TARGET)

samples/basic/src/free_buffer_early.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "wasm_export.h"
77
#include "bh_read_file.h"
8+
#include "bh_getopt.h"
89

910
void
1011
my_log(uint32 log_level, const char *file, int line, const char *fmt, ...)

wamr-compiler/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ if (NOT WAMR_BUILD_PLATFORM STREQUAL "windows")
1818
else()
1919
project (aot-compiler C ASM CXX)
2020
enable_language (ASM_MASM)
21-
add_definitions(-DCOMPILING_WASM_RUNTIME_API=1)
2221
endif()
2322

2423
set (CMAKE_CXX_STANDARD 17)

0 commit comments

Comments
 (0)