Skip to content

Commit

Permalink
Use zephyr_ CMake commands and set module name without spaces
Browse files Browse the repository at this point in the history
This makes the library compile also for PlatformIO.
  • Loading branch information
martinjaeger committed May 20, 2024
1 parent 1112475 commit 6e4c2ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
# This CMake file is picked by the Zephyr build system because it is defined
# as the module CMake entry point (see zephyr/module.yml).

if (CONFIG_THINGSET_SDK)
add_subdirectory(src)
endif()

add_subdirectory_ifdef(CONFIG_THINGSET_SDK src)
add_subdirectory_ifdef(CONFIG_ISOTP_FAST subsys/canbus/isotp_fast)

zephyr_include_directories(include)
30 changes: 16 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Copyright (c) The ThingSet Project Contributors
# SPDX-License-Identifier: Apache-2.0

target_sources_ifdef(CONFIG_THINGSET_SDK app PRIVATE sdk.c)
target_sources_ifdef(CONFIG_THINGSET_SDK app PRIVATE packetizer.c)
zephyr_library()

target_sources_ifdef(CONFIG_THINGSET_AUTH app PRIVATE auth.c)
target_sources_ifdef(CONFIG_THINGSET_BLE app PRIVATE ble.c)
target_sources_ifdef(CONFIG_THINGSET_CAN app PRIVATE can.c)
target_sources_ifdef(CONFIG_THINGSET_LOG_BACKEND app PRIVATE log_backend.c)
target_sources_ifdef(CONFIG_THINGSET_LORAWAN app PRIVATE lorawan.c)
target_sources_ifdef(CONFIG_THINGSET_SERIAL app PRIVATE serial.c)
target_sources_ifdef(CONFIG_THINGSET_SHELL app PRIVATE shell.c)
target_sources_ifdef(CONFIG_THINGSET_STORAGE app PRIVATE storage_common.c)
target_sources_ifdef(CONFIG_THINGSET_STORAGE_EEPROM app PRIVATE storage_eeprom.c)
target_sources_ifdef(CONFIG_THINGSET_STORAGE_FLASH app PRIVATE storage_flash.c)
target_sources_ifdef(CONFIG_THINGSET_WEBSOCKET app PRIVATE websocket.c)
target_sources_ifdef(CONFIG_THINGSET_WIFI app PRIVATE wifi.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_SDK sdk.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_SDK packetizer.c)

zephyr_library_sources_ifdef(CONFIG_THINGSET_AUTH auth.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_BLE ble.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_CAN can.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_LOG_BACKEND log_backend.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_LORAWAN lorawan.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_SERIAL serial.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_SHELL shell.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_STORAGE storage_common.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_STORAGE_EEPROM storage_eeprom.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_STORAGE_FLASH storage_flash.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_WEBSOCKET websocket.c)
zephyr_library_sources_ifdef(CONFIG_THINGSET_WIFI wifi.c)

generate_inc_file_for_target(
app
Expand Down
2 changes: 1 addition & 1 deletion zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) The ThingSet Project Contributors
# SPDX-License-Identifier: Apache-2.0

name: ThingSet SDK
name: thingset-sdk
build:
cmake: .
kconfig: Kconfig

0 comments on commit 6e4c2ea

Please sign in to comment.