CMakeLists.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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-linear-memory-wasm)
  5. add_definitions (-DRUN_ON_LINUX)
  6. set (WAMR_BUILD_LIBC_WASI 0)
  7. set (WAMR_BUILD_APP_FRAMEWORK 0)
  8. set (WAMR_BUILD_MEMORY_PROFILING 1)
  9. set (WAMR_BUILD_INTERP 1)
  10. set (WAMR_BUILD_AOT 0)
  11. include (../unit_common.cmake)
  12. include_directories (${CMAKE_CURRENT_SOURCE_DIR})
  13. file (GLOB_RECURSE source_all ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
  14. set (UNIT_SOURCE ${source_all})
  15. set (unit_test_sources
  16. ${UNIT_SOURCE}
  17. ${WAMR_RUNTIME_LIB_SOURCE}
  18. ${UNCOMMON_SHARED_SOURCE}
  19. )
  20. # Test case: .wasm file with hardware bound check.
  21. add_executable (linear_memory_test_wasm ${unit_test_sources})
  22. target_link_libraries (linear_memory_test_wasm gtest_main)
  23. gtest_discover_tests(linear_memory_test_wasm)
  24. target_compile_definitions(linear_memory_test_wasm PRIVATE WAMR_DISABLE_HW_BOUND_CHECK=0)
  25. add_custom_command(TARGET linear_memory_test_wasm POST_BUILD
  26. COMMAND ${CMAKE_COMMAND} -E copy
  27. ${CMAKE_CURRENT_LIST_DIR}/wasm_files/*
  28. ${CMAKE_CURRENT_BINARY_DIR}
  29. COMMENT "Copy wasm files to the directory: build/linear-memory-wasm."
  30. )
  31. # Test case: .wasm file with no hardware bound check.
  32. add_executable (linear_memory_test_wasm_no_hw_bound ${unit_test_sources})
  33. target_link_libraries (linear_memory_test_wasm_no_hw_bound gtest_main)
  34. gtest_discover_tests(linear_memory_test_wasm_no_hw_bound)
  35. target_compile_definitions(linear_memory_test_wasm_no_hw_bound PRIVATE WAMR_DISABLE_HW_BOUND_CHECK=1)