1*1ce6ee55SMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 2*1ce6ee55SMatthias Ringwald 3*1ce6ee55SMatthias Ringwaldproject(test-tlv-test) 4*1ce6ee55SMatthias Ringwald 5*1ce6ee55SMatthias Ringwaldset (BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../../) 6*1ce6ee55SMatthias Ringwald 7*1ce6ee55SMatthias Ringwald# pkgconfig required to link cpputest 8*1ce6ee55SMatthias Ringwaldfind_package(PkgConfig REQUIRED) 9*1ce6ee55SMatthias Ringwald 10*1ce6ee55SMatthias Ringwald# CppuTest 11*1ce6ee55SMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest) 12*1ce6ee55SMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS}) 13*1ce6ee55SMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS}) 14*1ce6ee55SMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES}) 15*1ce6ee55SMatthias Ringwald 16*1ce6ee55SMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc) 17*1ce6ee55SMatthias Ringwaldinclude_directories(../../3rd-party/rijndael) 18*1ce6ee55SMatthias Ringwaldinclude_directories(../../platform/embedded) 19*1ce6ee55SMatthias Ringwaldinclude_directories(../../platform/posix) 20*1ce6ee55SMatthias Ringwaldinclude_directories(../../src) 21*1ce6ee55SMatthias Ringwaldinclude_directories(..) 22*1ce6ee55SMatthias Ringwald 23*1ce6ee55SMatthias Ringwald# Enable ASAN 24*1ce6ee55SMatthias Ringwaldadd_compile_options( -g -fsanitize=address) 25*1ce6ee55SMatthias Ringwaldadd_link_options( -fsanitize=address) 26*1ce6ee55SMatthias Ringwald 27*1ce6ee55SMatthias Ringwald# create test targets 28*1ce6ee55SMatthias Ringwaldfile(GLOB TARGETS_CPP "*_test.cpp") 29*1ce6ee55SMatthias Ringwald# create targets 30*1ce6ee55SMatthias Ringwaldforeach(TARGET_FILE ${TARGETS_CPP}) 31*1ce6ee55SMatthias Ringwald get_filename_component(TEST ${TARGET_FILE} NAME_WE) 32*1ce6ee55SMatthias Ringwald message("test/btstack_util: ${TEST}") 33*1ce6ee55SMatthias Ringwald message("${TEST} - ${TARGET_FILE} - ${BTSTACK_ROOT}/src/le_audio/broadcast_audio_uri_builder.c") 34*1ce6ee55SMatthias Ringwald add_executable(${TEST} 35*1ce6ee55SMatthias Ringwald ${TARGET_FILE} 36*1ce6ee55SMatthias Ringwald ${BTSTACK_ROOT}/src/btstack_util.c 37*1ce6ee55SMatthias Ringwald ${BTSTACK_ROOT}/src/hci_dump.c 38*1ce6ee55SMatthias Ringwald ${BTSTACK_ROOT}/src/le-audio/broadcast_audio_uri_builder.c 39*1ce6ee55SMatthias Ringwald ) 40*1ce6ee55SMatthias Ringwaldendforeach(TARGET_FILE) 41*1ce6ee55SMatthias Ringwald 42*1ce6ee55SMatthias Ringwald 43