From 9773390537600314b375dcb55643cbf101acaa0e Mon Sep 17 00:00:00 2001 From: Liu Jia Date: Wed, 30 Apr 2025 14:10:56 +0800 Subject: [PATCH] set default value of `WAMR_BUILD_REF_TYPES` to 1 in standalone cases (#4227) - set default value of WAMR_BUILD_REF_TYPES to 1 in CMakeLists.txt --- tests/standalone/test-invoke-native/CMakeLists.txt | 5 +++++ tests/standalone/test-module-malloc/CMakeLists.txt | 3 +++ tests/standalone/test-module-malloc/run.sh | 1 - .../test-pthread/threads-opcode-wasm-apps/CMakeLists.txt | 2 +- .../standalone/test-running-modes/c-embed/CMakeLists.txt | 9 +++++++-- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/standalone/test-invoke-native/CMakeLists.txt b/tests/standalone/test-invoke-native/CMakeLists.txt index 54cec530a..9ba585842 100644 --- a/tests/standalone/test-invoke-native/CMakeLists.txt +++ b/tests/standalone/test-invoke-native/CMakeLists.txt @@ -88,6 +88,11 @@ if (NOT DEFINED WAMR_BUILD_SIMD) set (WAMR_BUILD_SIMD 0) endif () +if (NOT DEFINED WAMR_BUILD_REF_TYPES) + # Enable reference types by default + set (WAMR_BUILD_REF_TYPES 1) +endif () + set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) diff --git a/tests/standalone/test-module-malloc/CMakeLists.txt b/tests/standalone/test-module-malloc/CMakeLists.txt index 8081f9fa4..bdaff6834 100644 --- a/tests/standalone/test-module-malloc/CMakeLists.txt +++ b/tests/standalone/test-module-malloc/CMakeLists.txt @@ -48,6 +48,9 @@ endif () if (NOT WAMR_BUILD_AOT) set (WAMR_BUILD_AOT 1) endif () +if (NOT WAMR_BUILD_REF_TYPES) + set (WAMR_BUILD_REF_TYPES 1) +endif () set (WAMR_BUILD_LIBC_BUILTIN 1) set (WAMR_BUILD_LIBC_WASI 1) diff --git a/tests/standalone/test-module-malloc/run.sh b/tests/standalone/test-module-malloc/run.sh index 644544f08..a89a11654 100755 --- a/tests/standalone/test-module-malloc/run.sh +++ b/tests/standalone/test-module-malloc/run.sh @@ -55,4 +55,3 @@ else ./iwasm --native-lib=./libtest_module_malloc.so wasm-app/test.aot fi fi - diff --git a/tests/standalone/test-pthread/threads-opcode-wasm-apps/CMakeLists.txt b/tests/standalone/test-pthread/threads-opcode-wasm-apps/CMakeLists.txt index 4f8e21ac8..fa5b59a1b 100644 --- a/tests/standalone/test-pthread/threads-opcode-wasm-apps/CMakeLists.txt +++ b/tests/standalone/test-pthread/threads-opcode-wasm-apps/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14) project(wasm-apps) -set(WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../wamr) +set(WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) if (APPLE) set (HAVE_FLAG_SEARCH_PATHS_FIRST 0) diff --git a/tests/standalone/test-running-modes/c-embed/CMakeLists.txt b/tests/standalone/test-running-modes/c-embed/CMakeLists.txt index 52064ac44..a79ca33b5 100644 --- a/tests/standalone/test-running-modes/c-embed/CMakeLists.txt +++ b/tests/standalone/test-running-modes/c-embed/CMakeLists.txt @@ -11,10 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -project(c_embed_test) - cmake_minimum_required(VERSION 3.14) +project(c_embed_test) + include(CheckPIESupported) string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM) @@ -34,6 +34,11 @@ set(WAMR_BUILD_LIBC_WASI 1) set(WAMR_BUILD_SIMD 1) set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../..) +if (NOT DEFINED WAMR_BUILD_REF_TYPES) + # Enable reference types by default + set (WAMR_BUILD_REF_TYPES 1) +endif () + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") if (NOT WAMR_BUILD_PLATFORM STREQUAL "darwin") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -pie -fPIE")