1cmake_minimum_required (VERSION 3.5) 2 3project(test-tlv-test) 4 5set (BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../../) 6 7# pkgconfig required to link cpputest 8find_package(PkgConfig REQUIRED) 9 10# CppuTest 11pkg_check_modules(CPPUTEST REQUIRED CppuTest) 12include_directories(${CPPUTEST_INCLUDE_DIRS}) 13link_directories(${CPPUTEST_LIBRARY_DIRS}) 14link_libraries(${CPPUTEST_LIBRARIES}) 15 16include_directories(../../3rd-party/micro-ecc) 17include_directories(../../3rd-party/rijndael) 18include_directories(../../platform/embedded) 19include_directories(../../platform/posix) 20include_directories(../../src) 21include_directories(..) 22 23# test ENABLE_TLV_FLASH_WRITE_ONCE 24add_compile_definitions(ENABLE_TLV_FLASH_WRITE_ONCE) 25 26# Enable ASAN 27add_compile_options( -g -fsanitize=address) 28add_link_options( -fsanitize=address) 29 30add_executable(tlv_test 31 tlv_test.cpp 32 ${BTSTACK_ROOT}/src/btstack_util.c 33 ${BTSTACK_ROOT}/src/hci_dump.c 34 ${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c 35 ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c 36 ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c 37 ${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c 38) 39