unsupported_combination.cmake 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. include(CMakePrintHelpers)
  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. # Define a function to check for unsupported combinations with CLASSIC_INTERP
  11. function(check_classic_interp_error error_message)
  12. # Usually, Enable INTERP to enable wasm loader for JIT
  13. # WAMR_BUILD_JIT might be undefined, so check it first
  14. if(WAMR_BUILD_JIT EQUAL 1)
  15. return()
  16. endif()
  17. if(WAMR_BUILD_FAST_JIT EQUAL 1)
  18. return()
  19. endif()
  20. if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0)
  21. message(FATAL_ERROR "${error_message}")
  22. endif()
  23. endfunction()
  24. # Define a function to check for unsupported combinations with FAST_INTERP
  25. function(check_fast_interp_error error_message)
  26. # Usually, Enable INTERP to enable wasm loader for JIT
  27. # WAMR_BUILD_JIT might be undefined, so check it first
  28. if(WAMR_BUILD_JIT EQUAL 1)
  29. return()
  30. endif()
  31. if(WAMR_BUILD_FAST_JIT EQUAL 1)
  32. return()
  33. endif()
  34. if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1)
  35. message(FATAL_ERROR "${error_message}")
  36. endif()
  37. endfunction()
  38. # Define a function to check for unsupported combinations with FAST_JIT
  39. function(check_fast_jit_error error_message)
  40. if(WAMR_BUILD_FAST_JIT EQUAL 1)
  41. message(FATAL_ERROR "${error_message}")
  42. endif()
  43. endfunction()
  44. # Define a function to check for unsupported combinations with LLVM_JIT
  45. function(check_llvm_jit_error error_message)
  46. if(WAMR_BUILD_JIT EQUAL 1)
  47. message(FATAL_ERROR "${error_message}")
  48. endif()
  49. endfunction()
  50. # Below are the unsupported combinations checks
  51. # Please keep this list in sync with tests/unit/unsupported-features/CMakeLists.txt
  52. # and tests/wamr-test-suites/test_wamr.sh
  53. if(WAMR_BUILD_EXCE_HANDLING EQUAL 1)
  54. check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT")
  55. check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP")
  56. check_fast_jit_error("Unsupported build configuration: EXCE_HANDLING + FAST_JIT")
  57. check_llvm_jit_error("Unsupported build configuration: EXCE_HANDLING + JIT")
  58. endif()
  59. if(WAMR_BUILD_GC EQUAL 1)
  60. check_fast_jit_error("Unsupported build configuration: GC + FAST_JIT")
  61. endif()
  62. if(WAMR_BUILD_MEMORY64 EQUAL 1)
  63. check_fast_interp_error("Unsupported build configuration: MEMORY64 + FAST_INTERP")
  64. check_fast_jit_error("Unsupported build configuration: MEMORY64 + FAST_JIT")
  65. check_llvm_jit_error("Unsupported build configuration: MEMORY64 + JIT")
  66. endif()
  67. if(WAMR_BUILD_MULTI_MEMORY EQUAL 1)
  68. check_aot_mode_error("Unsupported build configuration: MULTI_MEMORY + AOT")
  69. check_fast_interp_error("Unsupported build configuration: MULTI_MEMORY + FAST_INTERP")
  70. check_fast_jit_error("Unsupported build configuration: MULTI_MEMORY + FAST_JIT")
  71. check_llvm_jit_error("Unsupported build configuration: MULTI_MEMORY + JIT")
  72. endif()
  73. if(WAMR_BUILD_MULTI_MODULE EQUAL 1)
  74. check_fast_jit_error("Unsupported build configuration: MULTI_MODULE + FAST_JIT")
  75. check_llvm_jit_error("Unsupported build configuration: MULTI_MODULE + JIT")
  76. endif()
  77. if(WAMR_BUILD_SHARED_HEAP EQUAL 1)
  78. check_fast_jit_error("Unsupported build configuration: SHARED_HEAP + FAST_JIT")
  79. endif()
  80. if(WAMR_BUILD_SIMD EQUAL 1)
  81. check_classic_interp_error("Unsupported build configuration: SIMD + CLASSIC_INTERP")
  82. check_fast_jit_error("Unsupported build configuration: SIMD + FAST_JIT")
  83. endif()