CMakeLists.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-wasm-vm)
  5. add_definitions (-DRUN_ON_LINUX)
  6. add_definitions (-Dattr_container_malloc=malloc)
  7. add_definitions (-Dattr_container_free=free)
  8. set (WAMR_BUILD_APP_FRAMEWORK 1)
  9. set (CMAKE_BUILD_TYPE Release)
  10. include (../unit_common.cmake)
  11. include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  12. file (GLOB_RECURSE source_all ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
  13. set (UNIT_SOURCE ${source_all})
  14. set (unit_test_sources
  15. ${UNIT_SOURCE}
  16. ${PLATFORM_SHARED_SOURCE}
  17. ${UTILS_SHARED_SOURCE}
  18. ${MEM_ALLOC_SHARED_SOURCE}
  19. ${LIB_HOST_AGENT_SOURCE}
  20. ${NATIVE_INTERFACE_SOURCE}
  21. ${LIBC_BUILTIN_SOURCE}
  22. ${LIBC_WASI_SOURCE}
  23. ${IWASM_COMMON_SOURCE}
  24. ${IWASM_INTERP_SOURCE}
  25. ${IWASM_AOT_SOURCE}
  26. ${IWASM_COMPL_SOURCE}
  27. ${WASM_APP_LIB_SOURCE_ALL}
  28. ${UNCOMMON_SHARED_SOURCE}
  29. )
  30. # Now simply link against gtest or gtest_main as needed. Eg
  31. add_executable(wasm_vm_test ${unit_test_sources})
  32. target_link_libraries(wasm_vm_test ${LLVM_AVAILABLE_LIBS} gtest_main)
  33. add_custom_command(TARGET wasm_vm_test POST_BUILD
  34. COMMAND ${CMAKE_COMMAND} -E copy
  35. ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps/app4/*.wasm
  36. ${PROJECT_BINARY_DIR}/
  37. COMMENT "Copy wasm files to the output directory"
  38. )
  39. gtest_discover_tests(wasm_vm_test)