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 <gregory.shue@legrand.us>
This commit is contained in:
Gregory Shue 2021-05-11 06:30:19 -07:00 committed by Carles Cufí
parent a061012215
commit 5a66095fa6
5 changed files with 15 additions and 0 deletions

View file

@ -5,3 +5,4 @@
# as the module CMake entry point (see zephyr/module.yml). # as the module CMake entry point (see zephyr/module.yml).
add_subdirectory(drivers) add_subdirectory(drivers)
add_subdirectory(lib)

View file

@ -6,3 +6,4 @@
# module options by going to Zephyr -> Modules in Kconfig. # module options by going to Zephyr -> Modules in Kconfig.
rsource "drivers/Kconfig" rsource "drivers/Kconfig"
rsource "lib/Kconfig"

View file

@ -10,6 +10,7 @@ applications. Some of the features demonstrated in this example are:
- [Custom boards][board_porting] - [Custom boards][board_porting]
- Custom [devicetree bindings][bindings] - Custom [devicetree bindings][bindings]
- Out-of-tree [drivers][drivers] - Out-of-tree [drivers][drivers]
- Out-of-tree libraries
- Example CI configuration (using Github Actions) - Example CI configuration (using Github Actions)
- Custom [west extension][west_ext] - Custom [west extension][west_ext]

6
lib/CMakeLists.txt Normal file
View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# The visibility and compilation of libraries may be controlled
# with a Kconfig setting as follows:
#
# add_subdirectory_ifdef(CONFIG_CUSTOM_LIB custom_lib)

6
lib/Kconfig Normal file
View file

@ -0,0 +1,6 @@
# Copyright (c) 2021 Legrand North America, LLC.
# SPDX-License-Identifier: Apache-2.0
menu "Libraries"
endmenu