From 0581893fd3b515598bf959d1e3fe829220d3d7b0 Mon Sep 17 00:00:00 2001 From: Yasushi SHOJI Date: Fri, 16 Aug 2024 16:38:44 +0900 Subject: [PATCH 1/2] drivers: Move drivers to the top directory To eliminate the "No SOURCES given to Zephyr library" warning displayed during the CMake run, we need to use the zephyr_library_amend() macro. However, this macro is only effective when the Zephyr driver hierarchy is followed. Moving zephyr/drivers to the top level achieves this. Signed-off-by: Yasushi SHOJI --- zephyr/CMakeLists.txt => CMakeLists.txt | 0 zephyr/Kconfig => Kconfig | 0 {zephyr/drivers => drivers}/can/CMakeLists.txt | 0 {zephyr/drivers => drivers}/can/Kconfig | 0 {zephyr/drivers => drivers}/can/Kconfig.sccan | 0 {zephyr/drivers => drivers}/can/can_sccan.c | 0 {zephyr/drivers => drivers}/i2c/CMakeLists.txt | 0 {zephyr/drivers => drivers}/i2c/Kconfig | 0 {zephyr/drivers => drivers}/i2c/Kconfig.sc | 0 {zephyr/drivers => drivers}/i2c/i2c_sc.c | 0 {zephyr/drivers => drivers}/misc/CMakeLists.txt | 0 {zephyr/drivers => drivers}/misc/Kconfig | 0 {zephyr/drivers => drivers}/misc/sc_dstrx3.c | 0 {zephyr/drivers => drivers}/misc/sc_dstrx3.h | 0 {zephyr/drivers => drivers}/pwm/CMakeLists.txt | 0 {zephyr/drivers => drivers}/pwm/Kconfig | 0 {zephyr/drivers => drivers}/pwm/Kconfig.sc | 0 {zephyr/drivers => drivers}/pwm/pwm_sc.c | 0 {zephyr/drivers => drivers}/spi/CMakeLists.txt | 0 {zephyr/drivers => drivers}/spi/Kconfig | 0 {zephyr/drivers => drivers}/spi/Kconfig.sc | 0 {zephyr/drivers => drivers}/spi/spi_sc.c | 0 zephyr/module.yml | 4 ++-- 23 files changed, 2 insertions(+), 2 deletions(-) rename zephyr/CMakeLists.txt => CMakeLists.txt (100%) rename zephyr/Kconfig => Kconfig (100%) rename {zephyr/drivers => drivers}/can/CMakeLists.txt (100%) rename {zephyr/drivers => drivers}/can/Kconfig (100%) rename {zephyr/drivers => drivers}/can/Kconfig.sccan (100%) rename {zephyr/drivers => drivers}/can/can_sccan.c (100%) rename {zephyr/drivers => drivers}/i2c/CMakeLists.txt (100%) rename {zephyr/drivers => drivers}/i2c/Kconfig (100%) rename {zephyr/drivers => drivers}/i2c/Kconfig.sc (100%) rename {zephyr/drivers => drivers}/i2c/i2c_sc.c (100%) rename {zephyr/drivers => drivers}/misc/CMakeLists.txt (100%) rename {zephyr/drivers => drivers}/misc/Kconfig (100%) rename {zephyr/drivers => drivers}/misc/sc_dstrx3.c (100%) rename {zephyr/drivers => drivers}/misc/sc_dstrx3.h (100%) rename {zephyr/drivers => drivers}/pwm/CMakeLists.txt (100%) rename {zephyr/drivers => drivers}/pwm/Kconfig (100%) rename {zephyr/drivers => drivers}/pwm/Kconfig.sc (100%) rename {zephyr/drivers => drivers}/pwm/pwm_sc.c (100%) rename {zephyr/drivers => drivers}/spi/CMakeLists.txt (100%) rename {zephyr/drivers => drivers}/spi/Kconfig (100%) rename {zephyr/drivers => drivers}/spi/Kconfig.sc (100%) rename {zephyr/drivers => drivers}/spi/spi_sc.c (100%) diff --git a/zephyr/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from zephyr/CMakeLists.txt rename to CMakeLists.txt diff --git a/zephyr/Kconfig b/Kconfig similarity index 100% rename from zephyr/Kconfig rename to Kconfig diff --git a/zephyr/drivers/can/CMakeLists.txt b/drivers/can/CMakeLists.txt similarity index 100% rename from zephyr/drivers/can/CMakeLists.txt rename to drivers/can/CMakeLists.txt diff --git a/zephyr/drivers/can/Kconfig b/drivers/can/Kconfig similarity index 100% rename from zephyr/drivers/can/Kconfig rename to drivers/can/Kconfig diff --git a/zephyr/drivers/can/Kconfig.sccan b/drivers/can/Kconfig.sccan similarity index 100% rename from zephyr/drivers/can/Kconfig.sccan rename to drivers/can/Kconfig.sccan diff --git a/zephyr/drivers/can/can_sccan.c b/drivers/can/can_sccan.c similarity index 100% rename from zephyr/drivers/can/can_sccan.c rename to drivers/can/can_sccan.c diff --git a/zephyr/drivers/i2c/CMakeLists.txt b/drivers/i2c/CMakeLists.txt similarity index 100% rename from zephyr/drivers/i2c/CMakeLists.txt rename to drivers/i2c/CMakeLists.txt diff --git a/zephyr/drivers/i2c/Kconfig b/drivers/i2c/Kconfig similarity index 100% rename from zephyr/drivers/i2c/Kconfig rename to drivers/i2c/Kconfig diff --git a/zephyr/drivers/i2c/Kconfig.sc b/drivers/i2c/Kconfig.sc similarity index 100% rename from zephyr/drivers/i2c/Kconfig.sc rename to drivers/i2c/Kconfig.sc diff --git a/zephyr/drivers/i2c/i2c_sc.c b/drivers/i2c/i2c_sc.c similarity index 100% rename from zephyr/drivers/i2c/i2c_sc.c rename to drivers/i2c/i2c_sc.c diff --git a/zephyr/drivers/misc/CMakeLists.txt b/drivers/misc/CMakeLists.txt similarity index 100% rename from zephyr/drivers/misc/CMakeLists.txt rename to drivers/misc/CMakeLists.txt diff --git a/zephyr/drivers/misc/Kconfig b/drivers/misc/Kconfig similarity index 100% rename from zephyr/drivers/misc/Kconfig rename to drivers/misc/Kconfig diff --git a/zephyr/drivers/misc/sc_dstrx3.c b/drivers/misc/sc_dstrx3.c similarity index 100% rename from zephyr/drivers/misc/sc_dstrx3.c rename to drivers/misc/sc_dstrx3.c diff --git a/zephyr/drivers/misc/sc_dstrx3.h b/drivers/misc/sc_dstrx3.h similarity index 100% rename from zephyr/drivers/misc/sc_dstrx3.h rename to drivers/misc/sc_dstrx3.h diff --git a/zephyr/drivers/pwm/CMakeLists.txt b/drivers/pwm/CMakeLists.txt similarity index 100% rename from zephyr/drivers/pwm/CMakeLists.txt rename to drivers/pwm/CMakeLists.txt diff --git a/zephyr/drivers/pwm/Kconfig b/drivers/pwm/Kconfig similarity index 100% rename from zephyr/drivers/pwm/Kconfig rename to drivers/pwm/Kconfig diff --git a/zephyr/drivers/pwm/Kconfig.sc b/drivers/pwm/Kconfig.sc similarity index 100% rename from zephyr/drivers/pwm/Kconfig.sc rename to drivers/pwm/Kconfig.sc diff --git a/zephyr/drivers/pwm/pwm_sc.c b/drivers/pwm/pwm_sc.c similarity index 100% rename from zephyr/drivers/pwm/pwm_sc.c rename to drivers/pwm/pwm_sc.c diff --git a/zephyr/drivers/spi/CMakeLists.txt b/drivers/spi/CMakeLists.txt similarity index 100% rename from zephyr/drivers/spi/CMakeLists.txt rename to drivers/spi/CMakeLists.txt diff --git a/zephyr/drivers/spi/Kconfig b/drivers/spi/Kconfig similarity index 100% rename from zephyr/drivers/spi/Kconfig rename to drivers/spi/Kconfig diff --git a/zephyr/drivers/spi/Kconfig.sc b/drivers/spi/Kconfig.sc similarity index 100% rename from zephyr/drivers/spi/Kconfig.sc rename to drivers/spi/Kconfig.sc diff --git a/zephyr/drivers/spi/spi_sc.c b/drivers/spi/spi_sc.c similarity index 100% rename from zephyr/drivers/spi/spi_sc.c rename to drivers/spi/spi_sc.c diff --git a/zephyr/module.yml b/zephyr/module.yml index 6142fb61..e02f5af9 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 build: - kconfig: zephyr/Kconfig - cmake: zephyr + kconfig: Kconfig + cmake: . settings: #board_root: . dts_root: zephyr From 69caa9811c78bdc7a9013e7b7897dadb3636646f Mon Sep 17 00:00:00 2001 From: Yasushi SHOJI Date: Fri, 16 Aug 2024 16:45:24 +0900 Subject: [PATCH 2/2] drivers: Replace zephyr_library with zephyr_library_amend Replace zephyr_library() with zephyr_library_amend() to silent a build warning like the following: CMake Warning at .../scsat1-fsw/workspace/zephyr/CMakeLists.txt:915 (message): No SOURCES given to Zephyr library: drivers__pwm Excluding target from build. CMake Warning at .../scsat1-fsw/workspace/zephyr/CMakeLists.txt:915 (message): No SOURCES given to Zephyr library: drivers__spi Excluding target from build. This commit does not include drivers/misc. zephyr/driver/misc doesn't call zephyr_library(). Thus, "No SOURCES" warning will not be generated. Signed-off-by: Yasushi SHOJI --- drivers/can/CMakeLists.txt | 2 +- drivers/i2c/CMakeLists.txt | 2 +- drivers/pwm/CMakeLists.txt | 2 +- drivers/spi/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/can/CMakeLists.txt b/drivers/can/CMakeLists.txt index 96572e64..dd75f728 100644 --- a/drivers/can/CMakeLists.txt +++ b/drivers/can/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2023 Space Cubics, LLC. # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_amend() zephyr_library_sources_ifdef(CONFIG_CAN_SCCAN can_sccan.c) diff --git a/drivers/i2c/CMakeLists.txt b/drivers/i2c/CMakeLists.txt index 8e35543b..19943432 100644 --- a/drivers/i2c/CMakeLists.txt +++ b/drivers/i2c/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2023 Space Cubics, LLC. # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_amend() zephyr_library_sources_ifdef(CONFIG_I2C_SC i2c_sc.c) diff --git a/drivers/pwm/CMakeLists.txt b/drivers/pwm/CMakeLists.txt index 7b9a5fbe..1e6329fa 100644 --- a/drivers/pwm/CMakeLists.txt +++ b/drivers/pwm/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2023 Space Cubics, LLC. # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_amend() zephyr_library_sources_ifdef(CONFIG_PWM_SC pwm_sc.c) diff --git a/drivers/spi/CMakeLists.txt b/drivers/spi/CMakeLists.txt index ca6c95f3..54aec3d6 100644 --- a/drivers/spi/CMakeLists.txt +++ b/drivers/spi/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_amend() zephyr_library_include_directories(${ZEPHYR_BASE}/drivers/spi) zephyr_library_sources_ifdef(CONFIG_SPI_SC_QSPI spi_sc.c)