Enhance uvwasi build process and fix wamrc windows build error (#1046)
And update related document
This commit is contained in:
@ -2,21 +2,22 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
set (LIBC_WASI_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
set (UVWASI_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../deps/uvwasi)
|
||||
|
||||
set (LIBUV_VERSION v1.42.0)
|
||||
|
||||
add_definitions (-DWASM_ENABLE_LIBC_WASI=1 -DWASM_ENABLE_UVWASI=1)
|
||||
|
||||
include(FetchContent)
|
||||
## https://libuv.org
|
||||
|
||||
## libuv
|
||||
FetchContent_Declare(
|
||||
libuv
|
||||
GIT_REPOSITORY https://github.com/libuv/libuv.git
|
||||
GIT_TAG ${LIBUV_VERSION})
|
||||
|
||||
GIT_TAG ${LIBUV_VERSION}
|
||||
)
|
||||
FetchContent_GetProperties(libuv)
|
||||
if(NOT libuv_POPULATED)
|
||||
message ("-- Fetching libuv ..")
|
||||
if (NOT libuv_POPULATED)
|
||||
message("-- Fetching libuv ..")
|
||||
FetchContent_Populate(libuv)
|
||||
include_directories("${libuv_SOURCE_DIR}/include")
|
||||
add_subdirectory(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
@ -24,8 +25,20 @@ if(NOT libuv_POPULATED)
|
||||
set_target_properties(uv_a PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
include_directories(${UVWASI_DIR}/include)
|
||||
## uvwasi
|
||||
FetchContent_Declare(
|
||||
uvwasi
|
||||
GIT_REPOSITORY https://github.com/nodejs/uvwasi.git
|
||||
GIT_TAG main
|
||||
)
|
||||
FetchContent_GetProperties(uvwasi)
|
||||
if (NOT uvwasi_POPULATED)
|
||||
message("-- Fetching uvwasi ..")
|
||||
FetchContent_Populate(uvwasi)
|
||||
include_directories("${uvwasi_SOURCE_DIR}/include")
|
||||
add_subdirectory(${uvwasi_SOURCE_DIR} ${uvwasi_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
file (GLOB_RECURSE source_all ${LIBC_WASI_DIR}/*.c ${UVWASI_DIR}/src/*.c)
|
||||
file (GLOB_RECURSE source_all ${LIBC_WASI_DIR}/*.c ${uvwasi_SOURCE_DIR}/src/*.c)
|
||||
|
||||
set (LIBC_WASI_SOURCE ${source_all})
|
||||
|
||||
Reference in New Issue
Block a user