CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. cmake_minimum_required(VERSION 2.9)
  4. project (test-interpreter)
  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. set (WAMR_BUILD_LIBC_WASI 0)
  10. set (WAMR_BUILD_APP_FRAMEWORK 1)
  11. set (WAMR_BUILD_AOT 0)
  12. include (../unit_common.cmake)
  13. include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  14. file (GLOB_RECURSE source_all ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
  15. set (UNIT_SOURCE ${source_all})
  16. set (unit_test_sources
  17. ${UNIT_SOURCE}
  18. ${PLATFORM_SHARED_SOURCE}
  19. ${UTILS_SHARED_SOURCE}
  20. ${MEM_ALLOC_SHARED_SOURCE}
  21. ${NATIVE_INTERFACE_SOURCE}
  22. ${LIBC_BUILTIN_SOURCE}
  23. ${IWASM_COMMON_SOURCE}
  24. ${IWASM_INTERP_SOURCE}
  25. )
  26. # Now simply link against gtest or gtest_main as needed. Eg
  27. add_executable (interpreter_test ${unit_test_sources})
  28. target_link_libraries (interpreter_test ${LLVM_AVAILABLE_LIBS} gtest_main )
  29. gtest_discover_tests(interpreter_test)