From 5a66095fa6e7954cd272a02f0540e69b8ae46a6b Mon Sep 17 00:00:00 2001 From: Gregory Shue Date: Tue, 11 May 2021 06:30:19 -0700 Subject: [PATCH] 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 --- CMakeLists.txt | 1 + Kconfig | 1 + README.md | 1 + lib/CMakeLists.txt | 6 ++++++ lib/Kconfig | 6 ++++++ 5 files changed, 15 insertions(+) create mode 100644 lib/CMakeLists.txt create mode 100644 lib/Kconfig diff --git a/CMakeLists.txt b/CMakeLists.txt index d2c2e87..704be97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,3 +5,4 @@ # as the module CMake entry point (see zephyr/module.yml). add_subdirectory(drivers) +add_subdirectory(lib) diff --git a/Kconfig b/Kconfig index 1e908a1..3bd03f2 100644 --- a/Kconfig +++ b/Kconfig @@ -6,3 +6,4 @@ # module options by going to Zephyr -> Modules in Kconfig. rsource "drivers/Kconfig" +rsource "lib/Kconfig" diff --git a/README.md b/README.md index 4841891..88a1c98 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ applications. Some of the features demonstrated in this example are: - [Custom boards][board_porting] - Custom [devicetree bindings][bindings] - Out-of-tree [drivers][drivers] +- Out-of-tree libraries - Example CI configuration (using Github Actions) - Custom [west extension][west_ext] diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..9ed8728 --- /dev/null +++ b/lib/CMakeLists.txt @@ -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) diff --git a/lib/Kconfig b/lib/Kconfig new file mode 100644 index 0000000..a84752d --- /dev/null +++ b/lib/Kconfig @@ -0,0 +1,6 @@ +# Copyright (c) 2021 Legrand North America, LLC. +# SPDX-License-Identifier: Apache-2.0 + +menu "Libraries" + +endmenu