mem_alloc.cmake 1006 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. set (MEM_ALLOC_DIR ${CMAKE_CURRENT_LIST_DIR})
  4. include_directories(${MEM_ALLOC_DIR})
  5. if (WAMR_BUILD_GC_VERIFY EQUAL 1)
  6. add_definitions (-DBH_ENABLE_GC_VERIFY=1)
  7. endif ()
  8. if (NOT DEFINED WAMR_BUILD_GC_CORRUPTION_CHECK)
  9. # Disable memory allocator heap corruption check
  10. # when GC is enabled
  11. if (WAMR_BUILD_GC EQUAL 1)
  12. set (WAMR_BUILD_GC_CORRUPTION_CHECK 0)
  13. else ()
  14. set (WAMR_BUILD_GC_CORRUPTION_CHECK 1)
  15. endif ()
  16. endif ()
  17. if (WAMR_BUILD_GC_CORRUPTION_CHECK EQUAL 0)
  18. add_definitions (-DBH_ENABLE_GC_CORRUPTION_CHECK=0)
  19. endif ()
  20. if (DEFINED WAMR_BUILD_GC_HEAP_SIZE_DEFAULT)
  21. add_definitions ("-DGC_HEAP_SIZE_DEFAULT=${WAMR_BUILD_GC_HEAP_SIZE_DEFAULT}")
  22. endif ()
  23. file (GLOB_RECURSE source_all
  24. ${MEM_ALLOC_DIR}/ems/*.c
  25. ${MEM_ALLOC_DIR}/tlsf/*.c
  26. ${MEM_ALLOC_DIR}/mem_alloc.c)
  27. set (MEM_ALLOC_SHARED_SOURCE ${source_all})