11# Copyright (C) 2019 Intel Corporation. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33
4+ include (CMakePrintHelpers )
5+
46# Define a function to check for unsupported combinations
57function (check_aot_mode_error error_message )
68 if (WAMR_BUILD_AOT EQUAL 1)
@@ -10,13 +12,33 @@ endfunction()
1012
1113# Define a function to check for unsupported combinations with CLASSIC_INTERP
1214function (check_classic_interp_error error_message )
13- if (WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0 AND WAMR_BUILD_JIT EQUAL 0)
15+ # Usually, Enable INTERP to enable wasm loader for JIT
16+ # WAMR_BUILD_JIT might be undefined, so check it first
17+ if (WAMR_BUILD_JIT EQUAL 1)
18+ return ()
19+ endif ()
20+
21+ if (WAMR_BUILD_FAST_JIT EQUAL 1)
22+ return ()
23+ endif ()
24+
25+ if (WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0)
1426 message (FATAL_ERROR "${error_message} " )
1527 endif ()
1628endfunction ()
1729
1830# Define a function to check for unsupported combinations with FAST_INTERP
1931function (check_fast_interp_error error_message )
32+ # Usually, Enable INTERP to enable wasm loader for JIT
33+ # WAMR_BUILD_JIT might be undefined, so check it first
34+ if (WAMR_BUILD_JIT EQUAL 1)
35+ return ()
36+ endif ()
37+
38+ if (WAMR_BUILD_FAST_JIT EQUAL 1)
39+ return ()
40+ endif ()
41+
2042 if (WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1)
2143 message (FATAL_ERROR "${error_message} " )
2244 endif ()
@@ -39,6 +61,8 @@ endfunction()
3961# Below are the unsupported combinations checks
4062# Please keep this list in sync with tests/unit/unsupported-features/CMakeLists.txt
4163# and tests/wamr-test-suites/test_wamr.sh
64+ #cmake_print_variables(WAMR_BUILD_INTERP WAMR_BUILD_FAST_INTERP WAMR_BUILD_JIT)
65+
4266if (WAMR_BUILD_EXCE_HANDLING EQUAL 1)
4367 check_aot_mode_error ("Unsupported build configuration: EXCE_HANDLING + AOT" )
4468 check_fast_interp_error ("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP" )
0 commit comments