Skip to content

Commit 7b7d8de

Browse files
committed
Keep fix the CMake compatibility issue
``` CMake Error at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ```
1 parent 4e50d21 commit 7b7d8de

File tree

29 files changed

+88
-25
lines changed

29 files changed

+88
-25
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ jobs:
317317
os: [ubuntu-22.04]
318318
wasi_sdk_release:
319319
[
320-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
320+
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
321321
]
322322
wabt_release:
323323
[
@@ -351,7 +351,7 @@ jobs:
351351
cd /opt
352352
sudo wget ${{ matrix.wasi_sdk_release }}
353353
sudo tar -xzf wasi-sdk-*.tar.gz
354-
sudo ln -sf wasi-sdk-20.0 wasi-sdk
354+
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
355355
356356
- name: download and install wabt
357357
run: |
@@ -466,7 +466,7 @@ jobs:
466466
os: [ubuntu-22.04]
467467
wasi_sdk_release:
468468
[
469-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
469+
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
470470
]
471471
wabt_release:
472472
[
@@ -484,7 +484,7 @@ jobs:
484484
cd /opt
485485
sudo wget ${{ matrix.wasi_sdk_release }}
486486
sudo tar -xzf wasi-sdk-*.tar.gz
487-
sudo ln -sf wasi-sdk-20.0 wasi-sdk
487+
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
488488
489489
- name: download and install wabt
490490
run: |
@@ -636,7 +636,7 @@ jobs:
636636
]
637637
wasi_sdk_release:
638638
[
639-
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
639+
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz"
640640
]
641641
include:
642642
- os: ubuntu-22.04
@@ -710,7 +710,7 @@ jobs:
710710
cd /opt
711711
sudo wget ${{ matrix.wasi_sdk_release }}
712712
sudo tar -xzf wasi-sdk-*.tar.gz
713-
sudo mv wasi-sdk-20.0 wasi-sdk
713+
sudo ln -sf wasi-sdk-25.0-x86_64-linux wasi-sdk
714714
715715
# It is a temporary solution until new wasi-sdk that includes bug fixes is released
716716
- name: build wasi-libc from source

core/iwasm/aot/iwasm_aot.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
5+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
6+
# from 3rd parties that we should not alter. Therefore, in addition to
7+
# changing the `cmake_minimum_required()`, we should also add a configuration
8+
# here that is compatible with earlier versions.
9+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 FORCE)
10+
411
set (IWASM_AOT_DIR ${CMAKE_CURRENT_LIST_DIR})
512

613
add_definitions (-DWASM_ENABLE_AOT=1)

core/iwasm/fast-jit/iwasm_fast_jit.cmake

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
set (IWASM_FAST_JIT_DIR ${CMAKE_CURRENT_LIST_DIR})
4+
include(CMakePrintHelpers)
5+
6+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
7+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
8+
# from 3rd parties that we should not alter. Therefore, in addition to
9+
# changing the `cmake_minimum_required()`, we should also add a configuration
10+
# here that is compatible with earlier versions.
11+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 FORCE)
512

13+
set (IWASM_FAST_JIT_DIR ${CMAKE_CURRENT_LIST_DIR})
614
add_definitions(-DWASM_ENABLE_FAST_JIT=1)
715
if (WAMR_BUILD_FAST_JIT_DUMP EQUAL 1)
816
add_definitions(-DWASM_ENABLE_FAST_JIT_DUMP=1)
@@ -27,6 +35,9 @@ if (WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
2735
PATCH_COMMAND git apply ${IWASM_FAST_JIT_DIR}/asmjit_sgx_patch.diff
2836
)
2937
endif ()
38+
39+
cmake_print_variables(CMAKE_POLICY_VERSION_MINIMUM WAMR_BUILD_FAST_JIT_DUMP)
40+
3041
FetchContent_GetProperties(asmjit)
3142
if (NOT asmjit_POPULATED)
3243
message ("-- Fetching asmjit ..")
@@ -51,6 +62,9 @@ if (WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
5162
)
5263
endif ()
5364
if (WAMR_BUILD_FAST_JIT_DUMP EQUAL 1)
65+
66+
cmake_print_variables(CMAKE_POLICY_VERSION_MINIMUM)
67+
5468
FetchContent_Declare(
5569
zycore
5670
GIT_REPOSITORY https://github.com/zyantific/zycore-c.git
@@ -66,6 +80,8 @@ if (WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
6680
add_subdirectory(${zycore_SOURCE_DIR} ${zycore_BINARY_DIR} EXCLUDE_FROM_ALL)
6781
file (GLOB_RECURSE c_source_zycore ${zycore_SOURCE_DIR}/src/*.c)
6882
endif ()
83+
84+
cmake_print_variables(CMAKE_POLICY_VERSION_MINIMUM)
6985
FetchContent_Declare(
7086
zydis
7187
GIT_REPOSITORY https://github.com/zyantific/zydis.git

core/iwasm/libraries/lib-rats/lib_rats.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# Copyright (c) 2020-2021 Alibaba Cloud
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
6+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
7+
# from 3rd parties that we should not alter. Therefore, in addition to
8+
# changing the `cmake_minimum_required()`, we should also add a configuration
9+
# here that is compatible with earlier versions.
10+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 FORCE)
11+
512
set (LIB_RATS_DIR ${CMAKE_CURRENT_LIST_DIR})
613

714
if ("$ENV{SGX_SSL_DIR}" STREQUAL "")

core/iwasm/libraries/libc-uvwasi/libc_uvwasi.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
5+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
6+
# from 3rd parties that we should not alter. Therefore, in addition to
7+
# changing the `cmake_minimum_required()`, we should also add a configuration
8+
# here that is compatible with earlier versions.
9+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 FORCE)
10+
411
set (LIBC_WASI_DIR ${CMAKE_CURRENT_LIST_DIR})
512

613
set (LIBUV_VERSION v1.46.0)

samples/multi-module/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ ExternalProject_Add(WASM_MODULE
148148
-DCMAKE_TOOLCHAIN_FILE=${WASI_TOOLCHAIN_FILE}
149149
-DCMAKE_SYSROOT=${WASI_SYS_ROOT}
150150
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
151+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
151152
-S ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps
152153
BUILD_COMMAND ${CMAKE_COMMAND} --build .
153154
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy

samples/multi-module/wasm-apps/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
cmake_minimum_required (VERSION 3.14)
55
project(wasm-apps)
66

7+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
8+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
9+
# from 3rd parties that we should not alter. Therefore, in addition to
10+
# changing the `cmake_minimum_required()`, we should also add a configuration
11+
# here that is compatible with earlier versions.
12+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
13+
714
message(CHECK_START "Detecting WABT")
815
if(NOT (DEFINED WABT_DIR OR DEFINED CACHE{WABT_DIR}))
916
find_path(WABT_DIR

samples/socket-api/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ ExternalProject_Add(wasm-app
8787
-DWASI_SDK_PREFIX=${WASI_SDK_DIR}
8888
-DCMAKE_TOOLCHAIN_FILE=${WASI_TOOLCHAIN_FILE}
8989
-DCMAKE_SYSROOT=${WASI_SYS_ROOT}
90+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
9091
${CMAKE_CURRENT_SOURCE_DIR}/wasm-src
9192
BUILD_COMMAND ${CMAKE_COMMAND} --build .
9293
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy

samples/socket-api/wasm-src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
cmake_minimum_required(VERSION 3.14)
55
project(socket_api_sample_wasm_app)
66

7+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
8+
# our `cmake_minimum_required()` to 3.14. However, there are CMakeLists.txt
9+
# from 3rd parties that we should not alter. Therefore, in addition to
10+
# changing the `cmake_minimum_required()`, we should also add a configuration
11+
# here that is compatible with earlier versions.
12+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
13+
714
message(CHECK_START "Detecting WABT")
815
if(NOT (DEFINED WABT_DIR OR DEFINED CACHE{WABT_DIR}))
916
find_path(WABT_DIR

samples/wasi-threads/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ set(WAMR_BUILD_LIBC_BUILTIN 1)
4949
set(WAMR_BUILD_FAST_INTERP 1)
5050
set(WAMR_BUILD_LIBC_WASI 1)
5151
set(WAMR_BUILD_LIB_WASI_THREADS 1)
52+
set(WAMR_BUILD_REF_TYPES 1)
5253

5354
# compiling and linking flags
5455
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))

0 commit comments

Comments
 (0)