CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. if (NOT DEFINED WAMR_BUILD_PLATFORM)
  12. string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
  13. endif ()
  14. include (../unit_common.cmake)
  15. add_library (tid_allocator_vmlib ${WAMR_RUNTIME_LIB_SOURCE})
  16. add_library (wamr_gtest_main main.cpp)
  17. target_link_libraries (wamr_gtest_main PUBLIC gtest tid_allocator_vmlib)
  18. function (create_wamr_unit_test test_name)
  19. set (sources ${ARGN})
  20. add_executable (${test_name} ${sources})
  21. target_link_libraries (
  22. ${test_name}
  23. wamr_gtest_main
  24. tid_allocator_vmlib
  25. ${LLVM_AVAILABLE_LIBS}
  26. )
  27. gtest_discover_tests (${test_name})
  28. endfunction ()
  29. include (${IWASM_DIR}/libraries/lib-wasi-threads/unit-test/lib_wasi_threads_unit_tests.cmake)