Skip to content

Commit d085d1c

Browse files
authored
Keep fix the CMake compatibility issue (#4180)
``` 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 46ec863 commit d085d1c

File tree

30 files changed

+104
-26
lines changed

30 files changed

+104
-26
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.5. 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
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+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
5+
# our `cmake_minimum_required()` to 3.5. 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)
510

11+
set (IWASM_FAST_JIT_DIR ${CMAKE_CURRENT_LIST_DIR})
612
add_definitions(-DWASM_ENABLE_FAST_JIT=1)
713
if (WAMR_BUILD_FAST_JIT_DUMP EQUAL 1)
814
add_definitions(-DWASM_ENABLE_FAST_JIT_DUMP=1)

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.5. 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.5. 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)

core/iwasm/libraries/simde/simde.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33
# simde is a header only library
44

5+
# Yes. To solve the compatibility issue with CMAKE (>= 4.0), we need to update
6+
# our `cmake_minimum_required()` to 3.5. 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_SIMDE_DIR ${CMAKE_CURRENT_LIST_DIR})
613

714
add_definitions (-DWASM_ENABLE_SIMDE=1)

core/iwasm/libraries/wasi-nn/cmake/Findcjson.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.5. 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
include(FetchContent)
512

613
set(CJSON_SOURCE_DIR "${WAMR_ROOT_DIR}/core/deps/cjson")

core/iwasm/libraries/wasi-nn/cmake/Findllamacpp.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.5. 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
include(FetchContent)
512

613
set(LLAMA_SOURCE_DIR "${WAMR_ROOT_DIR}/core/deps/llama.cpp")

core/iwasm/libraries/wasi-nn/cmake/Findtensorflow_lite.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.5. 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
include(FetchContent)
512

613
set(TFLITE_SOURCE_DIR "${WAMR_ROOT_DIR}/core/deps/tensorflow-src")

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)