unsupported_combination.cmake 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. cmake_print_variables(WAMR_BUILD_INTERP WAMR_BUILD_FAST_INTERP WAMR_BUILD_JIT WAMR_BUILD_EXCE_HANDLING)
  54. if(WAMR_BUILD_EXCE_HANDLING EQUAL 1)
  55. check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT")
  56. check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP")
  57. check_fast_jit_error("Unsupported build configuration: EXCE_HANDLING + FAST_JIT")
  58. check_llvm_jit_error("Unsupported build configuration: EXCE_HANDLING + JIT")
  59. endif()
  60. if(WAMR_BUILD_GC EQUAL 1)
  61. check_fast_jit_error("Unsupported build configuration: GC + FAST_JIT")
  62. endif()
  63. if(WAMR_BUILD_MEMORY64 EQUAL 1)
  64. check_fast_interp_error("Unsupported build configuration: MEMORY64 + FAST_INTERP")
  65. check_fast_jit_error("Unsupported build configuration: MEMORY64 + FAST_JIT")
  66. check_llvm_jit_error("Unsupported build configuration: MEMORY64 + JIT")
  67. endif()
  68. if(WAMR_BUILD_MULTI_MEMORY EQUAL 1)
  69. check_aot_mode_error("Unsupported build configuration: MULTI_MEMORY + AOT")
  70. check_fast_interp_error("Unsupported build configuration: MULTI_MEMORY + FAST_INTERP")
  71. check_fast_jit_error("Unsupported build configuration: MULTI_MEMORY + FAST_JIT")
  72. check_llvm_jit_error("Unsupported build configuration: MULTI_MEMORY + JIT")
  73. endif()
  74. if(WAMR_BUILD_MULTI_MODULE EQUAL 1)
  75. check_fast_jit_error("Unsupported build configuration: MULTI_MODULE + FAST_JIT")
  76. check_llvm_jit_error("Unsupported build configuration: MULTI_MODULE + JIT")
  77. endif()
  78. if(WAMR_BUILD_SHARED_HEAP EQUAL 1)
  79. check_fast_jit_error("Unsupported build configuration: SHARED_HEAP + FAST_JIT")
  80. endif()
  81. if(WAMR_BUILD_SIMD EQUAL 1)
  82. check_classic_interp_error("Unsupported build configuration: SIMD + CLASSIC_INTERP")
  83. check_fast_jit_error("Unsupported build configuration: SIMD + FAST_JIT")
  84. endif()