Skip to content

Commit f3cb867

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 f3cb867

21 files changed

Lines changed: 25 additions & 18 deletions

File tree

samples/multi-module/CMakeLists.txt

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

66
include(CheckPIESupported)
7+
include(CMakePrintHelpers)
78

89
project(multi_module)
910

@@ -137,6 +138,8 @@ else()
137138
message(STATUS "WASI_SYS_ROOT is ${WASI_SYS_ROOT}")
138139
endif()
139140

141+
cmake_print_variables(CMAKE_COMMAND)
142+
140143
# .c -> .wasm
141144
ExternalProject_Add(WASM_MODULE
142145
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps
@@ -148,6 +151,7 @@ ExternalProject_Add(WASM_MODULE
148151
-DCMAKE_TOOLCHAIN_FILE=${WASI_TOOLCHAIN_FILE}
149152
-DCMAKE_SYSROOT=${WASI_SYS_ROOT}
150153
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
154+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
151155
-S ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps
152156
BUILD_COMMAND ${CMAKE_COMMAND} --build .
153157
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy

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/wasm-c-api-imports/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ if(WAMR_BUILD_AOT EQUAL 1 AND WAMR_BUILD_INTERP EQUAL 0)
146146
-DWASM_TO_AOT=ON
147147
-DWAMRC_PATH=${CMAKE_CURRENT_BINARY_DIR}/wamrc
148148
-DSOCKET_WASI_CMAKE=${WAMR_ROOT}/core/iwasm/libraries/lib-socket/lib_socket_wasi.cmake
149+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
149150
BUILD_COMMAND ${CMAKE_COMMAND} --build build
150151
INSTALL_COMMAND ${CMAKE_COMMAND} --install build --prefix ${CMAKE_CURRENT_BINARY_DIR}
151152
)
@@ -159,6 +160,7 @@ else()
159160
-DCMAKE_TOOLCHAIN_FILE=${WASI_TOOLCHAIN_FILE}
160161
-DCMAKE_SYSROOT=${WASI_SYS_ROOT}
161162
-DSOCKET_WASI_CMAKE=${WAMR_ROOT}/core/iwasm/libraries/lib-socket/lib_socket_wasi.cmake
163+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
162164
BUILD_COMMAND ${CMAKE_COMMAND} --build build
163165
INSTALL_COMMAND ${CMAKE_COMMAND} --install build --prefix ${CMAKE_CURRENT_BINARY_DIR}
164166
)

tests/fuzz/wasm-mutator-fuzz/CMakeLists.txt

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

4-
cmake_minimum_required (VERSION 2.8)
4+
cmake_minimum_required (VERSION 3.14)
55

66
if (NOT DEFINED CMAKE_C_COMPILER)
77
set (CMAKE_C_COMPILER "clang")

tests/fuzz/wasm-mutator-fuzz/workspace/CMakeLists.txt

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

4-
cmake_minimum_required (VERSION 2.8)
4+
cmake_minimum_required (VERSION 3.14)
55

66
project(wasm_mutator)
77

tests/standalone/test-module-malloc/wasm-app/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 3.0)
4+
cmake_minimum_required(VERSION 3.14)
55
project(wasm-app)
66

77
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)

tests/unit/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 2.9)
4+
cmake_minimum_required(VERSION 3.14)
55

66
project(unit-test)
77

tests/unit/aot-stack-frame/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 2.9)
4+
cmake_minimum_required(VERSION 3.14)
55

66
project (test-aot-stack-frame)
77

tests/unit/aot-stack-frame/wasm-apps/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 2.9)
4+
cmake_minimum_required(VERSION 3.14)
55

66
project(wasm-apps-aot-stack-frame)
77

tests/unit/aot/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 2.9)
4+
cmake_minimum_required(VERSION 3.14)
55

66
project (test-aot)
77

0 commit comments

Comments
 (0)