diff --git a/tests/unit/shared-heap/wasm-apps/bulk-memory/CMakeLists.txt b/tests/unit/shared-heap/wasm-apps/bulk-memory/CMakeLists.txt new file mode 100644 index 000000000..b917a9432 --- /dev/null +++ b/tests/unit/shared-heap/wasm-apps/bulk-memory/CMakeLists.txt @@ -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 .)