forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunsupported_combination.cmake
More file actions
102 lines (84 loc) · 3.62 KB
/
unsupported_combination.cmake
File metadata and controls
102 lines (84 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
include(CMakePrintHelpers)
# Define a function to check for unsupported combinations
function(check_aot_mode_error error_message)
if(WAMR_BUILD_AOT EQUAL 1)
message(FATAL_ERROR "${error_message}")
endif()
endfunction()
# Define a function to check for unsupported combinations with CLASSIC_INTERP
function(check_classic_interp_error error_message)
# Usually, Enable INTERP to enable wasm loader for JIT
# WAMR_BUILD_JIT might be undefined, so check it first
if(WAMR_BUILD_JIT EQUAL 1)
return()
endif()
if(WAMR_BUILD_FAST_JIT EQUAL 1)
return()
endif()
if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0)
message(FATAL_ERROR "${error_message}")
endif()
endfunction()
# Define a function to check for unsupported combinations with FAST_INTERP
function(check_fast_interp_error error_message)
# Usually, Enable INTERP to enable wasm loader for JIT
# WAMR_BUILD_JIT might be undefined, so check it first
if(WAMR_BUILD_JIT EQUAL 1)
return()
endif()
if(WAMR_BUILD_FAST_JIT EQUAL 1)
return()
endif()
if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1)
message(FATAL_ERROR "${error_message}")
endif()
endfunction()
# Define a function to check for unsupported combinations with FAST_JIT
function(check_fast_jit_error error_message)
if(WAMR_BUILD_FAST_JIT EQUAL 1)
message(FATAL_ERROR "${error_message}")
endif()
endfunction()
# Define a function to check for unsupported combinations with LLVM_JIT
function(check_llvm_jit_error error_message)
if(WAMR_BUILD_JIT EQUAL 1)
message(FATAL_ERROR "${error_message}")
endif()
endfunction()
# Below are the unsupported combinations checks
# Please keep this list in sync with tests/unit/unsupported-features/CMakeLists.txt
# and tests/wamr-test-suites/test_wamr.sh
cmake_print_variables(WAMR_BUILD_INTERP WAMR_BUILD_FAST_INTERP WAMR_BUILD_JIT WAMR_BUILD_EXCE_HANDLING)
if(WAMR_BUILD_EXCE_HANDLING EQUAL 1)
check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT")
check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP")
check_fast_jit_error("Unsupported build configuration: EXCE_HANDLING + FAST_JIT")
check_llvm_jit_error("Unsupported build configuration: EXCE_HANDLING + JIT")
endif()
if(WAMR_BUILD_GC EQUAL 1)
check_fast_jit_error("Unsupported build configuration: GC + FAST_JIT")
endif()
if(WAMR_BUILD_MEMORY64 EQUAL 1)
check_fast_interp_error("Unsupported build configuration: MEMORY64 + FAST_INTERP")
check_fast_jit_error("Unsupported build configuration: MEMORY64 + FAST_JIT")
check_llvm_jit_error("Unsupported build configuration: MEMORY64 + JIT")
endif()
if(WAMR_BUILD_MULTI_MEMORY EQUAL 1)
check_aot_mode_error("Unsupported build configuration: MULTI_MEMORY + AOT")
check_fast_interp_error("Unsupported build configuration: MULTI_MEMORY + FAST_INTERP")
check_fast_jit_error("Unsupported build configuration: MULTI_MEMORY + FAST_JIT")
check_llvm_jit_error("Unsupported build configuration: MULTI_MEMORY + JIT")
endif()
if(WAMR_BUILD_MULTI_MODULE EQUAL 1)
check_fast_jit_error("Unsupported build configuration: MULTI_MODULE + FAST_JIT")
check_llvm_jit_error("Unsupported build configuration: MULTI_MODULE + JIT")
endif()
if(WAMR_BUILD_SHARED_HEAP EQUAL 1)
check_fast_jit_error("Unsupported build configuration: SHARED_HEAP + FAST_JIT")
endif()
if(WAMR_BUILD_SIMD EQUAL 1)
check_classic_interp_error("Unsupported build configuration: SIMD + CLASSIC_INTERP")
check_fast_jit_error("Unsupported build configuration: SIMD + FAST_JIT")
endif()