mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 00:28:18 +00:00
windows ports: enable PortAudio via pkg-config in CMake build
This commit is contained in:
parent
07e7c342a4
commit
42c5c5581b
@ -17,6 +17,20 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
# CMake 3.12 - add_compile_definitions(HAVE_PORTAUDIO)
|
||||
SET(CMAKE_C_FLAGS "-DHAVE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
# to generate .h from .gatt files
|
||||
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "btstack_config.h"
|
||||
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "btstack_audio.h"
|
||||
#include "btstack_chipset_da145xx.h"
|
||||
#include "btstack_debug.h"
|
||||
#include "btstack_event.h"
|
||||
@ -156,6 +157,11 @@ static void phase2(int status){
|
||||
const hci_transport_t * transport = hci_transport_h4_instance(uart_driver);
|
||||
hci_init(transport, (void*) &transport_config);
|
||||
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance());
|
||||
btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance());
|
||||
#endif
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
@ -17,6 +17,20 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
# CMake 3.12 - add_compile_definitions(HAVE_PORTAUDIO)
|
||||
SET(CMAKE_C_FLAGS "-DHAVE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
# to generate .h from .gatt files
|
||||
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -52,6 +52,7 @@
|
||||
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "bluetooth_company_id.h"
|
||||
#include "btstack_audio.h"
|
||||
#include "btstack_chipset_zephyr.h"
|
||||
#include "btstack_debug.h"
|
||||
#include "btstack_event.h"
|
||||
@ -172,6 +173,11 @@ int main(int argc, const char * argv[]){
|
||||
hci_init(transport, (void*) &config);
|
||||
hci_set_chipset(btstack_chipset_zephyr_instance());
|
||||
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance());
|
||||
btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance());
|
||||
#endif
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
@ -17,6 +17,20 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
# CMake 3.12 - add_compile_definitions(HAVE_PORTAUDIO)
|
||||
SET(CMAKE_C_FLAGS "-DHAVE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
# to generate .h from .gatt files
|
||||
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "bluetooth_company_id.h"
|
||||
#include "btstack_audio.h"
|
||||
#include "btstack_chipset_bcm.h"
|
||||
#include "btstack_chipset_cc256x.h"
|
||||
#include "btstack_chipset_csr.h"
|
||||
@ -253,6 +254,11 @@ int main(int argc, const char * argv[]){
|
||||
const hci_transport_t * transport = hci_transport_h4_instance(uart_driver);
|
||||
hci_init(transport, (void*) &config);
|
||||
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance());
|
||||
btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance());
|
||||
#endif
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
@ -17,6 +17,20 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
# CMake 3.12 - add_compile_definitions(HAVE_PORTAUDIO)
|
||||
SET(CMAKE_C_FLAGS "-DHAVE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
# Generate .h from .gatt files
|
||||
find_package (Python COMPONENTS Interpreter)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "btstack_config.h"
|
||||
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "btstack_audio.h"
|
||||
#include "btstack_chipset_intel_firmware.h"
|
||||
#include "btstack_debug.h"
|
||||
#include "btstack_event.h"
|
||||
@ -140,6 +141,11 @@ static void intel_firmware_done(int result){
|
||||
// init HCI
|
||||
hci_init(transport, NULL);
|
||||
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance());
|
||||
btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance());
|
||||
#endif
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
@ -17,6 +17,20 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
# CMake 3.12 - add_compile_definitions(HAVE_PORTAUDIO)
|
||||
SET(CMAKE_C_FLAGS "-DHAVE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
# to generate .h from .gatt files
|
||||
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
@ -51,13 +65,14 @@ file(GLOB SOURCES_RIJNDAEL "../../3rd-party/rijndael/rijndael.c")
|
||||
file(GLOB SOURCES_WINDOWS "../../platform/windows/*.c")
|
||||
file(GLOB SOURCES_ZEPHYR "../../chipset/zephyr/*.c")
|
||||
file(GLOB SOURCES_LC3_GOOGLE "../../3rd-party/lc3-google/src/*.c")
|
||||
file(GLOB SOURCES_PORT "*.c")
|
||||
file(GLOB SOURCES_PORT "main.c" "../../platform/posix/btstack_audio_portaudio.c")
|
||||
file(GLOB SOURCES_YXML "../../3rd-party/yxml/yxml.c")
|
||||
|
||||
file(GLOB SOURCES_BLE_OFF "../../src/ble/le_device_db_memory.c")
|
||||
list(REMOVE_ITEM SOURCES_BLE ${SOURCES_BLE_OFF})
|
||||
|
||||
|
||||
|
||||
set(SOURCES
|
||||
${SOURCES_BLE}
|
||||
${SOURCES_BLUEDROID}
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "btstack_config.h"
|
||||
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "btstack_audio.h"
|
||||
#include "btstack_debug.h"
|
||||
#include "btstack_event.h"
|
||||
#include "btstack_memory.h"
|
||||
@ -147,6 +148,11 @@ int main(int argc, const char * argv[]){
|
||||
// init HCI
|
||||
hci_init(hci_transport_usb_instance(), NULL);
|
||||
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance());
|
||||
btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance());
|
||||
#endif
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
hci_add_event_handler(&hci_event_callback_registration);
|
||||
|
Loading…
Reference in New Issue
Block a user