mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
test/auto-pts: use main from port/libusb, sanitize instead of coverage
This commit is contained in:
parent
77e8932bd4
commit
21f170cbf5
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project(BTstack)
|
||||
project(BTstack-AutoPTS)
|
||||
|
||||
# fink pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
@ -11,14 +11,9 @@ link_directories(${LIBUSB_LIBRARY_DIRS})
|
||||
link_libraries(${LIBUSB_LIBRARIES})
|
||||
|
||||
# add all directories
|
||||
include_directories((../../chipset/realtek))
|
||||
include_directories(../../3rd-party/micro-ecc)
|
||||
include_directories(../../3rd-party/lc3-google/include)
|
||||
# include_directories(../../3rd-party/bluedroid/decoder/include)
|
||||
# include_directories(../../3rd-party/bluedroid/encoder/include)
|
||||
# include_directories(../../3rd-party/md5)
|
||||
# include_directories(../../3rd-party/hxcmod-player)
|
||||
# include_directories(../../3rd-party/hxcmod-player/mod)
|
||||
# include_directories(../../3rd-party/yxml)
|
||||
include_directories(../../3rd-party/rijndael)
|
||||
include_directories(../../3rd-party/tinydir)
|
||||
include_directories(../../chipset/zephyr)
|
||||
@ -32,16 +27,16 @@ include_directories(..)
|
||||
|
||||
# find src files
|
||||
file(GLOB SOURCES_SRC "../../src/*.c" "../../example/sco_demo_util.c")
|
||||
file(GLOB SOURCES_CLASSIC ../../src/classic/btstack_link_key_db_tlv.c
|
||||
../../src/classic/rfcomm.c
|
||||
../../src/classic/sdp_server.c
|
||||
../../src/classic/sdp_util.c)
|
||||
file(GLOB SOURCES_BLE "../../src/ble/*.c")
|
||||
file(GLOB SOURCES_GATT "../../src/ble/gatt-service/*.c")
|
||||
# file(GLOB SOURCES_CLASSIC "../../src/classic/*.c")
|
||||
# file(GLOB SOURCES_BLUEDROID "../../3rd-party/bluedroid/encoder/srce/*.c" "../../3rd-party/bluedroid/decoder/srce/*.c")
|
||||
# file(GLOB SOURCES_MD5 "../../3rd-party/md5/md5.c")
|
||||
file(GLOB SOURCES_UECC "../../3rd-party/micro-ecc/uECC.c")
|
||||
# file(GLOB SOURCES_YXML "../../3rd-party/yxml/yxml.c")
|
||||
# file(GLOB SOURCES_HXCMOD "../../3rd-party/hxcmod-player/*.c" "../../3rd-party/hxcmod-player/mods/*.c")
|
||||
file(GLOB SOURCES_POSIX "../../platform/posix/*.c")
|
||||
file(GLOB SOURCES_LIBUSB "../../platform/libusb/*.c")
|
||||
file(GLOB SOURCES_REALTEK "../../chipset/realtek/*.c")
|
||||
file(GLOB SOURCES_ZEPHYR "../../chipset/zephyr/*.c")
|
||||
|
||||
# remove some
|
||||
@ -51,41 +46,21 @@ file(GLOB SOURCES_POSIX_OFF "../../platform/posix/le_device_db_fs.c")
|
||||
list(REMOVE_ITEM SOURCES_POSIX ${SOURCES_POSIX_OFF})
|
||||
|
||||
set(SOURCES
|
||||
# ${SOURCES_MD5}
|
||||
# ${SOURCES_YXML}
|
||||
# ${SOURCES_BLUEDROID}
|
||||
${SOURCES_POSIX}
|
||||
${SOURCES_LIBUSB}
|
||||
${SOURCES_SRC}
|
||||
${SOURCES_CLASSIC}
|
||||
${SOURCES_BLE}
|
||||
${SOURCES_GATT}
|
||||
# ${SOURCES_CLASSIC}
|
||||
${SOURCES_UECC}
|
||||
# ${SOURCES_HXCMOD}
|
||||
${SOURCES_REALTEK}
|
||||
${SOURCES_ZEPHYR}
|
||||
"../../3rd-party/rijndael/rijndael.c"
|
||||
)
|
||||
|
||||
add_compile_options(--coverage)
|
||||
add_link_options( --coverage)
|
||||
add_definitions( -DCOVERAGE)
|
||||
|
||||
# figure out how to flush gcov data, clang 10 provides __gcov_flush, while clang 13 provides __gcov_dump
|
||||
message("Compiler: ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
if ("${CMAKE_C_COMPILER_ID}" MATCHES ".*Clang.*")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13)
|
||||
message("Using __gcov_dump")
|
||||
add_definitions( -DHAVE_GCOV_DUMP)
|
||||
else()
|
||||
message("Using __gcov_flush")
|
||||
add_definitions( -DHAVE_GCOV_FLUSH)
|
||||
endif()
|
||||
else()
|
||||
# assume GCC
|
||||
message("Using __gcov_flush")
|
||||
add_definitions( -DHAVE_GCOV_FLUSH)
|
||||
endif()
|
||||
|
||||
# Enable ASAN
|
||||
add_compile_options( -g -fsanitize=address)
|
||||
add_link_options( -fsanitize=address)
|
||||
|
||||
# create static lib
|
||||
add_library(btstack STATIC ${SOURCES})
|
||||
@ -94,7 +69,7 @@ add_library(btstack STATIC ${SOURCES})
|
||||
set (EXAMPLE btpclient)
|
||||
|
||||
# create targets
|
||||
set (SOURCE_FILES ${EXAMPLE}.c main.c btp_socket.c)
|
||||
set (SOURCE_FILES ${EXAMPLE}.c ../../port/libusb/main.c btp_socket.c)
|
||||
|
||||
add_executable(${EXAMPLE} ${SOURCE_FILES} )
|
||||
target_link_libraries(${EXAMPLE} btstack)
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
|
||||
// BTstack features that can be enabled
|
||||
#define ENABLE_CLASSIC
|
||||
#define ENABLE_BLE
|
||||
#define ENABLE_BTP
|
||||
#define ENABLE_LE_CENTRAL
|
||||
|
Loading…
x
Reference in New Issue
Block a user