|
| 1 | +# Copyright (C) 2019 Intel Corporation. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | + |
| 4 | +# Define a function to check for unsupported combinations |
| 5 | +function(check_aot_mode_error error_message) |
| 6 | + if(WAMR_BUILD_AOT EQUAL 1) |
| 7 | + message(FATAL_ERROR "${error_message}") |
| 8 | + endif() |
| 9 | +endfunction() |
| 10 | + |
| 11 | +# Define a function to check for unsupported combinations with CLASSIC_INTERP |
| 12 | +function(check_classic_interp_error error_message) |
| 13 | + if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0) |
| 14 | + message(FATAL_ERROR "${error_message}") |
| 15 | + endif() |
| 16 | +endfunction() |
| 17 | + |
| 18 | +# Define a function to check for unsupported combinations with FAST_INTERP |
| 19 | +function(check_fast_interp_error error_message) |
| 20 | + if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1) |
| 21 | + message(FATAL_ERROR "${error_message}") |
| 22 | + endif() |
| 23 | +endfunction() |
| 24 | + |
| 25 | +# Define a function to check for unsupported combinations with FAST_JIT |
| 26 | +function(check_fast_jit_error error_message) |
| 27 | + if(WAMR_BUILD_FAST_JIT EQUAL 1) |
| 28 | + message(FATAL_ERROR "${error_message}") |
| 29 | + endif() |
| 30 | +endfunction() |
| 31 | + |
| 32 | +# Define a function to check for unsupported combinations with LLVM_JIT |
| 33 | +function(check_llvm_jit_error error_message) |
| 34 | + if(WAMR_BUILD_JIT EQUAL 1) |
| 35 | + message(FATAL_ERROR "${error_message}") |
| 36 | + endif() |
| 37 | +endfunction() |
| 38 | + |
| 39 | +# Below are the unsupported combinations checks |
| 40 | +# Please keep this list in sync with tests/unit/unsupported-features/CMakeLists.txt |
| 41 | +# and tests/wamr-test-suites/test_wamr.sh |
| 42 | +if(WAMR_BUILD_EXCE_HANDLING EQUAL 1) |
| 43 | + check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT") |
| 44 | + check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP") |
| 45 | + check_fast_jit_error("Unsupported build configuration: EXCE_HANDLING + FAST_JIT") |
| 46 | + check_llvm_jit_error("Unsupported build configuration: EXCE_HANDLING + JIT") |
| 47 | +endif() |
| 48 | + |
| 49 | +if(WAMR_BUILD_MEMORY64 EQUAL 1) |
| 50 | + check_fast_interp_error("Unsupported build configuration: MEMORY64 + FAST_INTERP") |
| 51 | + check_fast_jit_error("Unsupported build configuration: MEMORY64 + FAST_JIT") |
| 52 | + check_llvm_jit_error("Unsupported build configuration: MEMORY64 + JIT") |
| 53 | +endif() |
| 54 | + |
| 55 | +if(WAMR_BUILD_GC EQUAL 1) |
| 56 | + check_fast_jit_error("Unsupported build configuration: GC + FAST_JIT") |
| 57 | +endif() |
| 58 | + |
| 59 | +if(WAMR_BUILD_MULTI_MEMORY EQUAL 1) |
| 60 | + check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT") |
| 61 | + check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP") |
| 62 | + check_fast_jit_error("Unsupported build configuration: EXCE_HANDLING + FAST_JIT") |
| 63 | + check_llvm_jit_error("Unsupported build configuration: EXCE_HANDLING + JIT") |
| 64 | +endif() |
| 65 | + |
| 66 | +if(WAMR_BUILD_MULTI_MODULE EQUAL 1) |
| 67 | + check_fast_jit_error("Unsupported build configuration: MULTI_MODULE + FAST_JIT") |
| 68 | + check_llvm_jit_error("Unsupported build configuration: MULTI_MODULE + JIT") |
| 69 | +endif() |
| 70 | + |
| 71 | +if(WAMR_BUILD_SIMD EQUAL 1) |
| 72 | + check_classic_interp_error("Unsupported build configuration: SIMD + CLASSIC_INTERP") |
| 73 | + check_fast_jit_error("Unsupported build configuration: SIMD + FAST_JIT") |
| 74 | +endif() |
0 commit comments