15bc527feSMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 25bc527feSMatthias Ringwald 35bc527feSMatthias Ringwaldproject(test-tlv-test) 45bc527feSMatthias Ringwald 55bc527feSMatthias Ringwaldset (BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../../) 65bc527feSMatthias Ringwald 7c589a9bbSMatthias Ringwald# pkgconfig required to link cpputest 8c589a9bbSMatthias Ringwaldfind_package(PkgConfig REQUIRED) 9c589a9bbSMatthias Ringwald 10c589a9bbSMatthias Ringwald# CppuTest 11c589a9bbSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest) 12c589a9bbSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS}) 13c589a9bbSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS}) 14c589a9bbSMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES}) 155bc527feSMatthias Ringwald 165bc527feSMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc) 175bc527feSMatthias Ringwaldinclude_directories(../../3rd-party/rijndael) 185bc527feSMatthias Ringwaldinclude_directories(../../platform/embedded) 195bc527feSMatthias Ringwaldinclude_directories(../../platform/posix) 205bc527feSMatthias Ringwaldinclude_directories(../../src) 215bc527feSMatthias Ringwaldinclude_directories(..) 225bc527feSMatthias Ringwald 235bc527feSMatthias Ringwald# Enable ASAN 245bc527feSMatthias Ringwaldadd_compile_options( -g -fsanitize=address) 255bc527feSMatthias Ringwaldadd_link_options( -fsanitize=address) 265bc527feSMatthias Ringwald 27*2b49e57bSMatthias Ringwaldadd_executable(tlv_test_main 285bc527feSMatthias Ringwald tlv_test.cpp 295bc527feSMatthias Ringwald ${BTSTACK_ROOT}/src/btstack_util.c 305bc527feSMatthias Ringwald ${BTSTACK_ROOT}/src/hci_dump.c 315bc527feSMatthias Ringwald ${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c 325bc527feSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c 335bc527feSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c 345bc527feSMatthias Ringwald ${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c 355bc527feSMatthias Ringwald) 36*2b49e57bSMatthias Ringwald 37*2b49e57bSMatthias Ringwald# test ENABLE_TLV_FLASH_WRITE_ONCE 38*2b49e57bSMatthias Ringwaldadd_executable(tlv_test_write_once 39*2b49e57bSMatthias Ringwald tlv_test.cpp 40*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/btstack_util.c 41*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/hci_dump.c 42*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c 43*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c 44*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c 45*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c 46*2b49e57bSMatthias Ringwald) 47*2b49e57bSMatthias Ringwaldtarget_compile_definitions(tlv_test_write_once PUBLIC ENABLE_TLV_FLASH_WRITE_ONCE) 48*2b49e57bSMatthias Ringwald 49*2b49e57bSMatthias Ringwald# test ENABLE_TLV_FLASH_WRITE_ONCE 50*2b49e57bSMatthias Ringwaldadd_executable(tlv_test_delete_field 51*2b49e57bSMatthias Ringwald tlv_test.cpp 52*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/btstack_util.c 53*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/hci_dump.c 54*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c 55*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c 56*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c 57*2b49e57bSMatthias Ringwald ${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c 58*2b49e57bSMatthias Ringwald) 59*2b49e57bSMatthias Ringwaldtarget_compile_definitions(tlv_test_delete_field PUBLIC ENABLE_TLV_FLASH_EXPLICIT_DELETE_FIELD) 60