cmake: bluetooth: Don't #include gatt files from src files
Due to a bug in KBuild, bluetooth samples needed to #include the gatt sources to re-use code between samples. This bug was not ported to CMake so we can stop applying this workaround. gatt source files are now directly added to the 'app' library instead of having adapter source files in the app's src directory that \#include's the gatt files. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
f8dc4b6b50
commit
8f3fea300a
21 changed files with 27 additions and 40 deletions
|
@ -3,10 +3,10 @@ project(NONE)
|
||||||
|
|
||||||
target_sources(app PRIVATE
|
target_sources(app PRIVATE
|
||||||
src/main.c
|
src/main.c
|
||||||
src/hrs.c
|
../gatt/hrs.c
|
||||||
src/dis.c
|
../gatt/dis.c
|
||||||
src/bas.c
|
../gatt/bas.c
|
||||||
src/cts.c
|
../gatt/cts.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/bas.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/cts.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/hrs.c"
|
|
|
@ -2,6 +2,10 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||||
project(NONE)
|
project(NONE)
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
FILE(GLOB app_sources src/*.c)
|
||||||
target_sources(app PRIVATE ${app_sources})
|
target_sources(app PRIVATE
|
||||||
|
${app_sources}
|
||||||
|
../gatt/dis.c
|
||||||
|
../gatt/bas.c
|
||||||
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/bas.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -2,6 +2,9 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||||
project(NONE)
|
project(NONE)
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
FILE(GLOB app_sources src/*.c)
|
||||||
target_sources(app PRIVATE ${app_sources})
|
target_sources(app PRIVATE
|
||||||
|
${app_sources}
|
||||||
|
../gatt/dis.c
|
||||||
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -3,8 +3,8 @@ project(NONE)
|
||||||
|
|
||||||
target_sources(app PRIVATE
|
target_sources(app PRIVATE
|
||||||
src/main.c
|
src/main.c
|
||||||
src/bas.c
|
../gatt/bas.c
|
||||||
src/dis.c
|
../gatt/dis.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/bas.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -2,6 +2,11 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||||
project(NONE)
|
project(NONE)
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
FILE(GLOB app_sources src/*.c)
|
||||||
target_sources(app PRIVATE ${app_sources})
|
target_sources(app PRIVATE
|
||||||
|
${app_sources}
|
||||||
|
../gatt/hog.c
|
||||||
|
../gatt/dis.c
|
||||||
|
../gatt/bas.c
|
||||||
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/bas.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/hog.c"
|
|
|
@ -2,6 +2,11 @@ include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||||
project(NONE)
|
project(NONE)
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
FILE(GLOB app_sources src/*.c)
|
||||||
target_sources(app PRIVATE ${app_sources})
|
target_sources(app PRIVATE
|
||||||
|
${app_sources}
|
||||||
|
../gatt/hrs.c
|
||||||
|
../gatt/dis.c
|
||||||
|
../gatt/bas.c
|
||||||
|
)
|
||||||
|
|
||||||
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/samples/bluetooth)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/bas.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/dis.c"
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* Workaround build system bug that will put objects in source dir */
|
|
||||||
#include "../../gatt/hrs.c"
|
|
Loading…
Add table
Add a link
Reference in a new issue