CMakeLists.txt 986 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. cmake_minimum_required (VERSION 3.14)
  4. project (tid_allocator_tests)
  5. if (NOT DEFINED WAMR_BUILD_LIB_WASI_THREADS)
  6. set (WAMR_BUILD_LIB_WASI_THREADS 1)
  7. endif ()
  8. if (NOT DEFINED WAMR_BUILD_INTERP)
  9. set (WAMR_BUILD_INTERP 1)
  10. endif ()
  11. include (../unit_common.cmake)
  12. add_library (tid_allocator_vmlib ${WAMR_RUNTIME_LIB_SOURCE})
  13. add_library (wamr_gtest_main main.cpp)
  14. target_link_libraries (wamr_gtest_main PUBLIC gtest tid_allocator_vmlib)
  15. function (create_wamr_unit_test test_name)
  16. set (sources ${ARGN})
  17. add_executable (${test_name} ${sources})
  18. target_link_libraries (
  19. ${test_name}
  20. wamr_gtest_main
  21. tid_allocator_vmlib
  22. ${LLVM_AVAILABLE_LIBS}
  23. )
  24. gtest_discover_tests (${test_name})
  25. endfunction ()
  26. include (${IWASM_DIR}/libraries/lib-wasi-threads/unit-test/lib_wasi_threads_unit_tests.cmake)