xref: /btstack/test/flash_tlv/CMakeLists.txt (revision c589a9bb896bd3ca6ce0b0556b913c50596ccdf8)
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
7*c589a9bbSMatthias Ringwald# pkgconfig required to link cpputest
8*c589a9bbSMatthias Ringwaldfind_package(PkgConfig REQUIRED)
9*c589a9bbSMatthias Ringwald
10*c589a9bbSMatthias Ringwald# CppuTest
11*c589a9bbSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest)
12*c589a9bbSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS})
13*c589a9bbSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS})
14*c589a9bbSMatthias 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# test ENABLE_TLV_FLASH_WRITE_ONCE
245bc527feSMatthias Ringwaldadd_compile_definitions(ENABLE_TLV_FLASH_WRITE_ONCE)
255bc527feSMatthias Ringwald
265bc527feSMatthias Ringwald# Enable ASAN
275bc527feSMatthias Ringwaldadd_compile_options( -g -fsanitize=address)
285bc527feSMatthias Ringwaldadd_link_options(       -fsanitize=address)
295bc527feSMatthias Ringwald
305bc527feSMatthias Ringwaldadd_executable(tlv_test
315bc527feSMatthias Ringwald        tlv_test.cpp
325bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/src/btstack_util.c
335bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/src/hci_dump.c
345bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c
355bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c
365bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c
375bc527feSMatthias Ringwald        ${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c
385bc527feSMatthias Ringwald)
39