Skip to content

Commit 5a66095

Browse files
Gregory Shuecarlescufi
authored andcommitted
lib: create empty lib subsystem
Create lib subsystem with empty Kconfig menu, subsystem build file. Updated top-level build and documentation to include subsystem. This was created to provide an example of how the `lib/` directory can be connected to the Zephyr build system through `module.yml`, and so that CI can verify that the extension settings used here work with these sub-trees. . The approach follows the pattern of paralleling the Zephyr tree. An empty subsystem was implemented rather than a non-empty one in order to isolate the core changes from any specific library. This provides a clean reference for users. . It was assumed that some users will want to strip out the `lib/` subsystem separate from existing subsystems, and vice versa. . This was verified by: - visually verifying a clean build of: `west build -b custom_plank -p always example-application/app/` - visually verifying the subsystem appeared in the correct location in a clean build of: `west build -b custom_plank -p always example-application/app/` Signed-off-by: Gregory Shue <[email protected]>
1 parent a061012 commit 5a66095

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
# as the module CMake entry point (see zephyr/module.yml).
66

77
add_subdirectory(drivers)
8+
add_subdirectory(lib)

Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# module options by going to Zephyr -> Modules in Kconfig.
77

88
rsource "drivers/Kconfig"
9+
rsource "lib/Kconfig"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ applications. Some of the features demonstrated in this example are:
1010
- [Custom boards][board_porting]
1111
- Custom [devicetree bindings][bindings]
1212
- Out-of-tree [drivers][drivers]
13+
- Out-of-tree libraries
1314
- Example CI configuration (using Github Actions)
1415
- Custom [west extension][west_ext]
1516

lib/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# The visibility and compilation of libraries may be controlled
4+
# with a Kconfig setting as follows:
5+
#
6+
# add_subdirectory_ifdef(CONFIG_CUSTOM_LIB custom_lib)

lib/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021 Legrand North America, LLC.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
menu "Libraries"
5+
6+
endmenu

0 commit comments

Comments
 (0)