mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-11 20:21:11 +00:00

Raise wasi-sdk to 25 and wabt to 1.0.37. It includes - Refactor CI workflow to install WASI-SDK and WABT from a composite action - Use ExternalProject to bring wasm-apps for few samples. file/ wasi-threads/ - Refactor sample build and test steps in SGX compilation workflow for improved clarity and efficiency (workaround) Add CMake support for EMSCRIPTEN and WAMRC, update module paths
31 lines
981 B
CMake
31 lines
981 B
CMake
# Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
cmake_minimum_required (VERSION 3.14)
|
|
project (wasi_threads_wasm)
|
|
|
|
set (CMAKE_BUILD_TYPE Debug) # Otherwise no debug symbols (addr2line)
|
|
|
|
function (compile_sample SOURCE_FILE)
|
|
get_filename_component (FILE_NAME ${SOURCE_FILE} NAME_WLE)
|
|
set (WASM_MODULE ${FILE_NAME}.wasm)
|
|
add_executable (${WASM_MODULE} ${SOURCE_FILE} ${ARGN})
|
|
|
|
target_compile_options (${WASM_MODULE} PRIVATE
|
|
-pthread -ftls-model=local-exec)
|
|
|
|
target_link_options (${WASM_MODULE} PRIVATE
|
|
-z stack-size=32768
|
|
LINKER:--export=__heap_base
|
|
LINKER:--export=__data_end
|
|
LINKER:--shared-memory,--max-memory=1966080
|
|
LINKER:--export=wasi_thread_start
|
|
LINKER:--export=malloc
|
|
LINKER:--export=free
|
|
)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${WASM_MODULE} DESTINATION wasm-apps)
|
|
endfunction ()
|
|
|
|
compile_sample(no_pthread.c wasi_thread_start.S)
|