CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. cmake_minimum_required(VERSION 3.14)
  4. project (test-aot)
  5. add_definitions (-DRUN_ON_LINUX)
  6. add_definitions (-Dattr_container_malloc=malloc)
  7. add_definitions (-Dattr_container_free=free)
  8. add_definitions (-DWASM_ENABLE_WAMR_COMPILER=1)
  9. add_definitions (-DWASM_ENABLE_DUMP_CALL_STACK=1)
  10. add_definitions (-DWASM_ENABLE_AOT_STACK_FRAME=1)
  11. set (WAMR_BUILD_AOT 1)
  12. set (WAMR_BUILD_FAST_INTERP 0)
  13. set (WAMR_BUILD_INTERP 1)
  14. set (WAMR_BUILD_JIT 0)
  15. set (WAMR_BUILD_LIBC_WASI 0)
  16. set (WAMR_BUILD_APP_FRAMEWORK 0)
  17. include (../unit_common.cmake)
  18. find_package(LLVM REQUIRED CONFIG)
  19. include_directories(${LLVM_INCLUDE_DIRS})
  20. add_definitions(${LLVM_DEFINITIONS})
  21. include (${IWASM_DIR}/compilation/iwasm_compl.cmake)
  22. include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  23. file (GLOB_RECURSE source_all ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
  24. set (UNIT_SOURCE ${source_all})
  25. set (unit_test_sources
  26. ${UNIT_SOURCE}
  27. ${WAMR_RUNTIME_LIB_SOURCE}
  28. ${IWASM_COMPL_SOURCE}
  29. )
  30. # Now simply link against gtest or gtest_main as needed. Eg
  31. add_executable (aot_test ${unit_test_sources})
  32. target_link_libraries (aot_test ${LLVM_AVAILABLE_LIBS} gtest_main )
  33. gtest_discover_tests(aot_test)