mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-03-03 01:51:32 +00:00
feat: add CMakeLists.txt for bulk-memory test
This commit is contained in:
parent
f6101c507c
commit
ffe7829f0f
40
tests/unit/shared-heap/wasm-apps/bulk-memory/CMakeLists.txt
Normal file
40
tests/unit/shared-heap/wasm-apps/bulk-memory/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# Copyright (C) 2024 Xiaomi Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(wasm-apps-bulk-memory)
|
||||
|
||||
# Find WAMRC
|
||||
set(WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
|
||||
set(WAMRC_ROOT_DIR ${WAMR_ROOT_DIR}/wamr-compiler)
|
||||
find_program(WAMRC_BIN wamrc HINTS ${WAMRC_ROOT_DIR}/build REQUIRED)
|
||||
|
||||
# Set architecture-specific WAMRC flags
|
||||
if (WAMR_BUILD_TARGET STREQUAL "X86_32")
|
||||
set(WAMRC_SHARED_HEAP_FLAGS --opt-level=3 --bounds-checks=1 --enable-shared-heap --target=i386)
|
||||
set(WAMRC_SHARED_HEAP_CHAIN_FLAGS --opt-level=3 --bounds-checks=1 --enable-shared-chain --target=i386)
|
||||
else ()
|
||||
set(WAMRC_SHARED_HEAP_FLAGS --opt-level=3 --bounds-checks=1 --enable-shared-heap)
|
||||
set(WAMRC_SHARED_HEAP_CHAIN_FLAGS --opt-level=3 --bounds-checks=1 --enable-shared-chain)
|
||||
endif ()
|
||||
|
||||
# Compile AOT files (combined target)
|
||||
add_custom_target(compile_aot ALL
|
||||
COMMAND ${WAMRC_BIN} ${WAMRC_SHARED_HEAP_FLAGS} -o test_bulk_memory.aot test_bulk_memory.wasm
|
||||
COMMAND ${WAMRC_BIN} ${WAMRC_SHARED_HEAP_CHAIN_FLAGS} -o test_bulk_memory_chain.aot test_bulk_memory.wasm
|
||||
DEPENDS test_bulk_memory.wasm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Install WASM file
|
||||
set(WASM_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_bulk_memory.wasm
|
||||
)
|
||||
install(FILES ${WASM_FILES} DESTINATION .)
|
||||
|
||||
# Install AOT files
|
||||
set(AOT_FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_bulk_memory.aot
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_bulk_memory_chain.aot
|
||||
)
|
||||
install(FILES ${AOT_FILES} DESTINATION .)
|
||||
Loading…
Reference in New Issue
Block a user