diff --git a/cmake/qemu/CMakeLists.txt b/cmake/qemu/CMakeLists.txt index 03a654ef97c..ccf1116f6a0 100644 --- a/cmake/qemu/CMakeLists.txt +++ b/cmake/qemu/CMakeLists.txt @@ -22,6 +22,14 @@ if(EMU_PLATFORM) endif() endif() + # Add a BT serial device when building for bluetooth, unless the + # application explicitly opts out with NO_QEMU_SERIAL_BT_SERVER. + if(CONFIG_BT) + if(NOT NO_QEMU_SERIAL_BT_SERVER) + list(APPEND QEMU_FLAGS -serial unix:/tmp/bt-server-bredr) + endif() + endif() + if(QEMU_NET_STACK) list(APPEND qemu_targets client diff --git a/samples/bluetooth/central/CMakeLists.txt b/samples/bluetooth/central/CMakeLists.txt index d625a83262b..a2659f105a5 100644 --- a/samples/bluetooth/central/CMakeLists.txt +++ b/samples/bluetooth/central/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c ) diff --git a/samples/bluetooth/central_hr/CMakeLists.txt b/samples/bluetooth/central_hr/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/central_hr/CMakeLists.txt +++ b/samples/bluetooth/central_hr/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/eddystone/CMakeLists.txt b/samples/bluetooth/eddystone/CMakeLists.txt index d625a83262b..a2659f105a5 100644 --- a/samples/bluetooth/eddystone/CMakeLists.txt +++ b/samples/bluetooth/eddystone/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c ) diff --git a/samples/bluetooth/handsfree/CMakeLists.txt b/samples/bluetooth/handsfree/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/handsfree/CMakeLists.txt +++ b/samples/bluetooth/handsfree/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/hci_spi/CMakeLists.txt b/samples/bluetooth/hci_spi/CMakeLists.txt index 5312f470839..99226c4bea8 100644 --- a/samples/bluetooth/hci_spi/CMakeLists.txt +++ b/samples/bluetooth/hci_spi/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/ipsp/CMakeLists.txt b/samples/bluetooth/ipsp/CMakeLists.txt index ceecc3b697e..f5f5245b085 100644 --- a/samples/bluetooth/ipsp/CMakeLists.txt +++ b/samples/bluetooth/ipsp/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c ) diff --git a/samples/bluetooth/mesh/CMakeLists.txt b/samples/bluetooth/mesh/CMakeLists.txt index 348a75e1724..7c9bf64261b 100644 --- a/samples/bluetooth/mesh/CMakeLists.txt +++ b/samples/bluetooth/mesh/CMakeLists.txt @@ -1,4 +1,4 @@ -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr -s) +set(QEMU_EXTRA_FLAGS -s) include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) diff --git a/samples/bluetooth/mesh_demo/CMakeLists.txt b/samples/bluetooth/mesh_demo/CMakeLists.txt index dc46ded98de..adc8d0fc131 100644 --- a/samples/bluetooth/mesh_demo/CMakeLists.txt +++ b/samples/bluetooth/mesh_demo/CMakeLists.txt @@ -1,4 +1,4 @@ -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr -s) +set(QEMU_EXTRA_FLAGS -s) include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) diff --git a/samples/bluetooth/peripheral/CMakeLists.txt b/samples/bluetooth/peripheral/CMakeLists.txt index 08e17d47eb7..3177fd301da 100644 --- a/samples/bluetooth/peripheral/CMakeLists.txt +++ b/samples/bluetooth/peripheral/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c src/hrs.c diff --git a/samples/bluetooth/peripheral_csc/CMakeLists.txt b/samples/bluetooth/peripheral_csc/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/peripheral_csc/CMakeLists.txt +++ b/samples/bluetooth/peripheral_csc/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/peripheral_dis/CMakeLists.txt b/samples/bluetooth/peripheral_dis/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/peripheral_dis/CMakeLists.txt +++ b/samples/bluetooth/peripheral_dis/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/peripheral_esp/CMakeLists.txt b/samples/bluetooth/peripheral_esp/CMakeLists.txt index 943a4216ca3..f4629d86b42 100644 --- a/samples/bluetooth/peripheral_esp/CMakeLists.txt +++ b/samples/bluetooth/peripheral_esp/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c src/bas.c diff --git a/samples/bluetooth/peripheral_hids/CMakeLists.txt b/samples/bluetooth/peripheral_hids/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/peripheral_hids/CMakeLists.txt +++ b/samples/bluetooth/peripheral_hids/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/peripheral_hr/CMakeLists.txt b/samples/bluetooth/peripheral_hr/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/peripheral_hr/CMakeLists.txt +++ b/samples/bluetooth/peripheral_hr/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/bluetooth/peripheral_sc_only/CMakeLists.txt b/samples/bluetooth/peripheral_sc_only/CMakeLists.txt index d625a83262b..a2659f105a5 100644 --- a/samples/bluetooth/peripheral_sc_only/CMakeLists.txt +++ b/samples/bluetooth/peripheral_sc_only/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - target_sources(app PRIVATE src/main.c ) diff --git a/samples/bluetooth/scan_adv/CMakeLists.txt b/samples/bluetooth/scan_adv/CMakeLists.txt index a1000bf8d5c..37764b00b3d 100644 --- a/samples/bluetooth/scan_adv/CMakeLists.txt +++ b/samples/bluetooth/scan_adv/CMakeLists.txt @@ -1,8 +1,6 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -set(QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/tests/bluetooth/bluetooth/CMakeLists.txt b/tests/bluetooth/bluetooth/CMakeLists.txt index 443d3d49be7..55984c64e97 100644 --- a/tests/bluetooth/bluetooth/CMakeLists.txt +++ b/tests/bluetooth/bluetooth/CMakeLists.txt @@ -1,3 +1,5 @@ +set(NO_QEMU_SERIAL_BT_SERVER 1) + include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) diff --git a/tests/bluetooth/tester/CMakeLists.txt b/tests/bluetooth/tester/CMakeLists.txt index b607b23e17f..9a9afe8ba18 100644 --- a/tests/bluetooth/tester/CMakeLists.txt +++ b/tests/bluetooth/tester/CMakeLists.txt @@ -1,11 +1,10 @@ set(CONF_FILE default.conf) +LIST(APPEND QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-stack-tester) + include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) project(NONE) -LIST(APPEND QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-stack-tester) -LIST(APPEND QEMU_EXTRA_FLAGS -serial unix:/tmp/bt-server-bredr) - zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth) target_sources(app PRIVATE src/main.c