diff --git a/boards/arc/hsdk/CMakeLists.txt b/boards/arc/hsdk/CMakeLists.txt index 137efa662a1e15..d6f1821d7a738d 100644 --- a/boards/arc/hsdk/CMakeLists.txt +++ b/boards/arc/hsdk/CMakeLists.txt @@ -3,5 +3,7 @@ # # SPDX-License-Identifier: Apache-2.0 # - -zephyr_sources_ifdef(CONFIG_PINMUX_HSDK pinmux.c) +if(CONFIG_PINMUX_HSDK) + zephyr_library_named(pinmux) + zephyr_library_sources(pinmux.c) +endif() diff --git a/boards/arm/adafruit_feather_m0_basic_proto/CMakeLists.txt b/boards/arm/adafruit_feather_m0_basic_proto/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/adafruit_feather_m0_basic_proto/CMakeLists.txt +++ b/boards/arm/adafruit_feather_m0_basic_proto/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/adafruit_itsybitsy_m4_express/CMakeLists.txt b/boards/arm/adafruit_itsybitsy_m4_express/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/adafruit_itsybitsy_m4_express/CMakeLists.txt +++ b/boards/arm/adafruit_itsybitsy_m4_express/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/adafruit_trinket_m0/CMakeLists.txt b/boards/arm/adafruit_trinket_m0/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/adafruit_trinket_m0/CMakeLists.txt +++ b/boards/arm/adafruit_trinket_m0/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/arduino_nano_33_iot/CMakeLists.txt b/boards/arm/arduino_nano_33_iot/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/arduino_nano_33_iot/CMakeLists.txt +++ b/boards/arm/arduino_nano_33_iot/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/arduino_zero/CMakeLists.txt b/boards/arm/arduino_zero/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/arduino_zero/CMakeLists.txt +++ b/boards/arm/arduino_zero/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/atsamd20_xpro/CMakeLists.txt b/boards/arm/atsamd20_xpro/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/atsamd20_xpro/CMakeLists.txt +++ b/boards/arm/atsamd20_xpro/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/atsamd21_xpro/CMakeLists.txt b/boards/arm/atsamd21_xpro/CMakeLists.txt index 5cd526557dff71..5f43bccca5cb39 100644 --- a/boards/arm/atsamd21_xpro/CMakeLists.txt +++ b/boards/arm/atsamd21_xpro/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2018 Bryan O'Donoghue # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/atsame54_xpro/CMakeLists.txt b/boards/arm/atsame54_xpro/CMakeLists.txt index 5cd526557dff71..5f43bccca5cb39 100644 --- a/boards/arm/atsame54_xpro/CMakeLists.txt +++ b/boards/arm/atsame54_xpro/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2018 Bryan O'Donoghue # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/atsamr21_xpro/CMakeLists.txt b/boards/arm/atsamr21_xpro/CMakeLists.txt index c18356d51f211b..572d736a58effc 100644 --- a/boards/arm/atsamr21_xpro/CMakeLists.txt +++ b/boards/arm/atsamr21_xpro/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright (c) 2019 Benjamin Valentin # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/cc3220sf_launchxl/CMakeLists.txt b/boards/arm/cc3220sf_launchxl/CMakeLists.txt index b2aecd19cdbfff..1d321794d4b182 100644 --- a/boards/arm/cc3220sf_launchxl/CMakeLists.txt +++ b/boards/arm/cc3220sf_launchxl/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +zephyr_library_named(pinmux) +zephyr_library_sources(pinmux.c) + zephyr_library() -zephyr_library_sources( - pinmux.c - dbghdr.c - ) +zephyr_library_sources(dbghdr.c) diff --git a/boards/arm/cc3235sf_launchxl/CMakeLists.txt b/boards/arm/cc3235sf_launchxl/CMakeLists.txt index b2aecd19cdbfff..1d321794d4b182 100644 --- a/boards/arm/cc3235sf_launchxl/CMakeLists.txt +++ b/boards/arm/cc3235sf_launchxl/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +zephyr_library_named(pinmux) +zephyr_library_sources(pinmux.c) + zephyr_library() -zephyr_library_sources( - pinmux.c - dbghdr.c - ) +zephyr_library_sources(dbghdr.c) diff --git a/boards/arm/colibri_imx7d_m4/CMakeLists.txt b/boards/arm/colibri_imx7d_m4/CMakeLists.txt index d7bf33d4d7f0d7..a49c69b109fbe5 100644 --- a/boards/arm/colibri_imx7d_m4/CMakeLists.txt +++ b/boards/arm/colibri_imx7d_m4/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/frdm_k22f/CMakeLists.txt b/boards/arm/frdm_k22f/CMakeLists.txt index e8cb2cf3408f8b..684c9678e6ee31 100644 --- a/boards/arm/frdm_k22f/CMakeLists.txt +++ b/boards/arm/frdm_k22f/CMakeLists.txt @@ -5,6 +5,6 @@ # if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/frdm_k64f/CMakeLists.txt b/boards/arm/frdm_k64f/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/frdm_k64f/CMakeLists.txt +++ b/boards/arm/frdm_k64f/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/frdm_k82f/CMakeLists.txt b/boards/arm/frdm_k82f/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/frdm_k82f/CMakeLists.txt +++ b/boards/arm/frdm_k82f/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/frdm_kl25z/CMakeLists.txt b/boards/arm/frdm_kl25z/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/frdm_kl25z/CMakeLists.txt +++ b/boards/arm/frdm_kl25z/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/frdm_kw41z/CMakeLists.txt b/boards/arm/frdm_kw41z/CMakeLists.txt index 9bc25bae4c64e6..f14110e6e3ae3a 100644 --- a/boards/arm/frdm_kw41z/CMakeLists.txt +++ b/boards/arm/frdm_kw41z/CMakeLists.txt @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/hexiwear_k64/CMakeLists.txt b/boards/arm/hexiwear_k64/CMakeLists.txt index 9bc25bae4c64e6..f14110e6e3ae3a 100644 --- a/boards/arm/hexiwear_k64/CMakeLists.txt +++ b/boards/arm/hexiwear_k64/CMakeLists.txt @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/hexiwear_kw40z/CMakeLists.txt b/boards/arm/hexiwear_kw40z/CMakeLists.txt index 9bc25bae4c64e6..f14110e6e3ae3a 100644 --- a/boards/arm/hexiwear_kw40z/CMakeLists.txt +++ b/boards/arm/hexiwear_kw40z/CMakeLists.txt @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/ip_k66f/CMakeLists.txt b/boards/arm/ip_k66f/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/ip_k66f/CMakeLists.txt +++ b/boards/arm/ip_k66f/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/lpcxpresso54114/CMakeLists.txt b/boards/arm/lpcxpresso54114/CMakeLists.txt index 9d065a9846caa3..ad4063787c64ef 100644 --- a/boards/arm/lpcxpresso54114/CMakeLists.txt +++ b/boards/arm/lpcxpresso54114/CMakeLists.txt @@ -5,6 +5,6 @@ # if(CONFIG_PINMUX_MCUX_LPC) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/lpcxpresso55s16/CMakeLists.txt b/boards/arm/lpcxpresso55s16/CMakeLists.txt index 9ba35cbbd68464..249c0a901d09e9 100644 --- a/boards/arm/lpcxpresso55s16/CMakeLists.txt +++ b/boards/arm/lpcxpresso55s16/CMakeLists.txt @@ -5,6 +5,6 @@ # if(CONFIG_PINMUX_MCUX_LPC) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/lpcxpresso55s28/CMakeLists.txt b/boards/arm/lpcxpresso55s28/CMakeLists.txt index d54aa10be89836..741fe9697384bb 100644 --- a/boards/arm/lpcxpresso55s28/CMakeLists.txt +++ b/boards/arm/lpcxpresso55s28/CMakeLists.txt @@ -5,6 +5,6 @@ # if(CONFIG_PINMUX_MCUX_LPC) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/lpcxpresso55s69/CMakeLists.txt b/boards/arm/lpcxpresso55s69/CMakeLists.txt index da71503103e07e..fedbf004d81d77 100644 --- a/boards/arm/lpcxpresso55s69/CMakeLists.txt +++ b/boards/arm/lpcxpresso55s69/CMakeLists.txt @@ -6,7 +6,7 @@ # if(CONFIG_PINMUX_MCUX_LPC) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/mec1501modular_assy6885/CMakeLists.txt b/boards/arm/mec1501modular_assy6885/CMakeLists.txt index f96a887b053ce8..d0f372367d7016 100644 --- a/boards/arm/mec1501modular_assy6885/CMakeLists.txt +++ b/boards/arm/mec1501modular_assy6885/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if(DEFINED ENV{EVERGLADES_SPI_GEN}) diff --git a/boards/arm/mec15xxevb_assy6853/CMakeLists.txt b/boards/arm/mec15xxevb_assy6853/CMakeLists.txt index 7b0c4c7898bd4c..4af435297ed525 100644 --- a/boards/arm/mec15xxevb_assy6853/CMakeLists.txt +++ b/boards/arm/mec15xxevb_assy6853/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if(DEFINED ENV{EVERGLADES_SPI_GEN}) diff --git a/boards/arm/mec172xevb_assy6906/CMakeLists.txt b/boards/arm/mec172xevb_assy6906/CMakeLists.txt index a68877db7d90a2..3fed3b68d43f69 100644 --- a/boards/arm/mec172xevb_assy6906/CMakeLists.txt +++ b/boards/arm/mec172xevb_assy6906/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if(DEFINED ENV{MEC172X_SPI_GEN}) diff --git a/boards/arm/mec2016evb_assy6797/CMakeLists.txt b/boards/arm/mec2016evb_assy6797/CMakeLists.txt index 17fd9d4425cac1..07f2c4c9a4674d 100644 --- a/boards/arm/mec2016evb_assy6797/CMakeLists.txt +++ b/boards/arm/mec2016evb_assy6797/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimx8mm_evk/CMakeLists.txt b/boards/arm/mimx8mm_evk/CMakeLists.txt index 37ee4952839c10..f88460728f4fe1 100644 --- a/boards/arm/mimx8mm_evk/CMakeLists.txt +++ b/boards/arm/mimx8mm_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt1010_evk/CMakeLists.txt b/boards/arm/mimxrt1010_evk/CMakeLists.txt index 123e27bf96f816..7c30dee1006e9d 100644 --- a/boards/arm/mimxrt1010_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1010_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt1015_evk/CMakeLists.txt b/boards/arm/mimxrt1015_evk/CMakeLists.txt index 123e27bf96f816..7c30dee1006e9d 100644 --- a/boards/arm/mimxrt1015_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1015_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt1020_evk/CMakeLists.txt b/boards/arm/mimxrt1020_evk/CMakeLists.txt index 1e00cea9b61135..5077bd716cd164 100644 --- a/boards/arm/mimxrt1020_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1020_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt1024_evk/CMakeLists.txt b/boards/arm/mimxrt1024_evk/CMakeLists.txt index 3f8f3c9e80c171..733af0eb6141bd 100644 --- a/boards/arm/mimxrt1024_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1024_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt1050_evk/CMakeLists.txt b/boards/arm/mimxrt1050_evk/CMakeLists.txt index d4167c422674f8..326d4d9c0511cd 100644 --- a/boards/arm/mimxrt1050_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1050_evk/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if (CONFIG_DISPLAY) diff --git a/boards/arm/mimxrt1060_evk/CMakeLists.txt b/boards/arm/mimxrt1060_evk/CMakeLists.txt index 778b7f2cb38cc5..cad1d476bd69f3 100644 --- a/boards/arm/mimxrt1060_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1060_evk/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if (CONFIG_DISPLAY) diff --git a/boards/arm/mimxrt1064_evk/CMakeLists.txt b/boards/arm/mimxrt1064_evk/CMakeLists.txt index 778b7f2cb38cc5..cad1d476bd69f3 100644 --- a/boards/arm/mimxrt1064_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1064_evk/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) if (CONFIG_DISPLAY) diff --git a/boards/arm/mimxrt1170_evk/CMakeLists.txt b/boards/arm/mimxrt1170_evk/CMakeLists.txt index 7f5e92617d06fb..23906f13f57f0f 100644 --- a/boards/arm/mimxrt1170_evk/CMakeLists.txt +++ b/boards/arm/mimxrt1170_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mimxrt685_evk/CMakeLists.txt b/boards/arm/mimxrt685_evk/CMakeLists.txt index 3f8f3c9e80c171..733af0eb6141bd 100644 --- a/boards/arm/mimxrt685_evk/CMakeLists.txt +++ b/boards/arm/mimxrt685_evk/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/mm_feather/CMakeLists.txt b/boards/arm/mm_feather/CMakeLists.txt index 22e8a9e01d4cf4..706adaddb0f0ab 100644 --- a/boards/arm/mm_feather/CMakeLists.txt +++ b/boards/arm/mm_feather/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR flexspi_nor_config.c) zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA mmfeather_sdram_ini_dcd.c) diff --git a/boards/arm/mm_swiftio/CMakeLists.txt b/boards/arm/mm_swiftio/CMakeLists.txt index 0fb173ff73227a..d49ea6a96a3f03 100644 --- a/boards/arm/mm_swiftio/CMakeLists.txt +++ b/boards/arm/mm_swiftio/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR flexspi_nor_config.c) zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA mmswiftio_sdram_ini_dcd.c) diff --git a/boards/arm/mps2_an385/CMakeLists.txt b/boards/arm/mps2_an385/CMakeLists.txt index bd78505d38b753..9ba001bbadecad 100644 --- a/boards/arm/mps2_an385/CMakeLists.txt +++ b/boards/arm/mps2_an385/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) diff --git a/boards/arm/mps2_an521/CMakeLists.txt b/boards/arm/mps2_an521/CMakeLists.txt index cba78c3000929c..63473515c4022a 100644 --- a/boards/arm/mps2_an521/CMakeLists.txt +++ b/boards/arm/mps2_an521/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) diff --git a/boards/arm/pico_pi_m4/CMakeLists.txt b/boards/arm/pico_pi_m4/CMakeLists.txt index 64b3f1d675da4d..54610e52f575fb 100644 --- a/boards/arm/pico_pi_m4/CMakeLists.txt +++ b/boards/arm/pico_pi_m4/CMakeLists.txt @@ -3,5 +3,5 @@ # # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/sam4e_xpro/CMakeLists.txt b/boards/arm/sam4e_xpro/CMakeLists.txt index 7061de0d7a5a41..feaf552c40a6a2 100644 --- a/boards/arm/sam4e_xpro/CMakeLists.txt +++ b/boards/arm/sam4e_xpro/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/sam_e70_xplained/CMakeLists.txt b/boards/arm/sam_e70_xplained/CMakeLists.txt index 7061de0d7a5a41..feaf552c40a6a2 100644 --- a/boards/arm/sam_e70_xplained/CMakeLists.txt +++ b/boards/arm/sam_e70_xplained/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/sam_v71_xult/CMakeLists.txt b/boards/arm/sam_v71_xult/CMakeLists.txt index 7061de0d7a5a41..feaf552c40a6a2 100644 --- a/boards/arm/sam_v71_xult/CMakeLists.txt +++ b/boards/arm/sam_v71_xult/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/seeeduino_xiao/CMakeLists.txt b/boards/arm/seeeduino_xiao/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/seeeduino_xiao/CMakeLists.txt +++ b/boards/arm/seeeduino_xiao/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/serpente/CMakeLists.txt b/boards/arm/serpente/CMakeLists.txt index 69ff5e8fbf8390..eef0ffebd5ab03 100644 --- a/boards/arm/serpente/CMakeLists.txt +++ b/boards/arm/serpente/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_SAM0) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/stm32g0316_disco/CMakeLists.txt b/boards/arm/stm32g0316_disco/CMakeLists.txt index 59170926fdabdf..2c43d636fc817d 100644 --- a/boards/arm/stm32g0316_disco/CMakeLists.txt +++ b/boards/arm/stm32g0316_disco/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX) -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/teensy4/CMakeLists.txt b/boards/arm/teensy4/CMakeLists.txt index bb7336d6c16e07..11c21de0758442 100644 --- a/boards/arm/teensy4/CMakeLists.txt +++ b/boards/arm/teensy4/CMakeLists.txt @@ -5,10 +5,11 @@ # if(CONFIG_PINMUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) endif() +zephyr_library() zephyr_library_sources(flexspi_nor_config.c) zephyr_library_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA teensy4_sdram_ini_dcd.c) diff --git a/boards/arm/twr_ke18f/CMakeLists.txt b/boards/arm/twr_ke18f/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/twr_ke18f/CMakeLists.txt +++ b/boards/arm/twr_ke18f/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/twr_kv58f220m/CMakeLists.txt b/boards/arm/twr_kv58f220m/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/twr_kv58f220m/CMakeLists.txt +++ b/boards/arm/twr_kv58f220m/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/udoo_neo_full_m4/CMakeLists.txt b/boards/arm/udoo_neo_full_m4/CMakeLists.txt index 1e00cea9b61135..5077bd716cd164 100644 --- a/boards/arm/udoo_neo_full_m4/CMakeLists.txt +++ b/boards/arm/udoo_neo_full_m4/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/usb_kw24d512/CMakeLists.txt b/boards/arm/usb_kw24d512/CMakeLists.txt index 77353a23d1d5ff..9958290d459c56 100644 --- a/boards/arm/usb_kw24d512/CMakeLists.txt +++ b/boards/arm/usb_kw24d512/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_MCUX) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/v2m_beetle/CMakeLists.txt b/boards/arm/v2m_beetle/CMakeLists.txt index 13a812f409abf0..781e5ab11ba2bd 100644 --- a/boards/arm/v2m_beetle/CMakeLists.txt +++ b/boards/arm/v2m_beetle/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_BEETLE) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) zephyr_library_sources(pinmux.c) endif() diff --git a/boards/arm/v2m_musca_b1/CMakeLists.txt b/boards/arm/v2m_musca_b1/CMakeLists.txt index 2ba52c47c83c70..de415e78c25484 100644 --- a/boards/arm/v2m_musca_b1/CMakeLists.txt +++ b/boards/arm/v2m_musca_b1/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/v2m_musca_s1/CMakeLists.txt b/boards/arm/v2m_musca_s1/CMakeLists.txt index bbb12938dceeeb..495c3e93a81612 100644 --- a/boards/arm/v2m_musca_s1/CMakeLists.txt +++ b/boards/arm/v2m_musca_s1/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/arm/warp7_m4/CMakeLists.txt b/boards/arm/warp7_m4/CMakeLists.txt index d7bf33d4d7f0d7..a49c69b109fbe5 100644 --- a/boards/arm/warp7_m4/CMakeLists.txt +++ b/boards/arm/warp7_m4/CMakeLists.txt @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/riscv/hifive1/CMakeLists.txt b/boards/riscv/hifive1/CMakeLists.txt index 9bc25bae4c64e6..f14110e6e3ae3a 100644 --- a/boards/riscv/hifive1/CMakeLists.txt +++ b/boards/riscv/hifive1/CMakeLists.txt @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/riscv/hifive1_revb/CMakeLists.txt b/boards/riscv/hifive1_revb/CMakeLists.txt index b2626340b8d373..65f20353528662 100644 --- a/boards/riscv/hifive1_revb/CMakeLists.txt +++ b/boards/riscv/hifive1_revb/CMakeLists.txt @@ -1,4 +1,4 @@ # Copyright (c) 2019 SiFive Inc. # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/riscv/it8xxx2_evb/CMakeLists.txt b/boards/riscv/it8xxx2_evb/CMakeLists.txt index 4b9798beb013e1..a532c08f2f0476 100644 --- a/boards/riscv/it8xxx2_evb/CMakeLists.txt +++ b/boards/riscv/it8xxx2_evb/CMakeLists.txt @@ -2,5 +2,5 @@ # Copyright (c) 2020 ITE Corporation. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/riscv/rv32m1_vega/CMakeLists.txt b/boards/riscv/rv32m1_vega/CMakeLists.txt index 9bc25bae4c64e6..f14110e6e3ae3a 100644 --- a/boards/riscv/rv32m1_vega/CMakeLists.txt +++ b/boards/riscv/rv32m1_vega/CMakeLists.txt @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) diff --git a/boards/xtensa/intel_s1000_crb/CMakeLists.txt b/boards/xtensa/intel_s1000_crb/CMakeLists.txt index aa04cf71208c05..875a6f4ca7ff70 100644 --- a/boards/xtensa/intel_s1000_crb/CMakeLists.txt +++ b/boards/xtensa/intel_s1000_crb/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_PINMUX_INTEL_S1000) - zephyr_library() + zephyr_library_named(pinmux) zephyr_library_sources(pinmux.c) endif() diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index 498c5acc10db97..134865142f9032 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -426,6 +426,17 @@ endmacro() # Provides amend functionality to a Zephyr library for out-of-tree usage. # +# Usage: +# zephyr_library_amend([]) +# +# When called with a library name, then the library must already have been +# defined in the build system. +# Afterwards, additional source may be amended to the existing library. +# +# Example: +# zephyr_library_amend(foo) +# zephyr_library_sources(bar.c) +# # When called from a Zephyr module, the corresponding zephyr library defined # within Zephyr will be looked up. # @@ -452,16 +463,20 @@ endmacro() # expressions. # macro(zephyr_library_amend) - # This is a macro because we need to ensure the ZEPHYR_CURRENT_LIBRARY and - # following zephyr_library_* calls are executed within the scope of the - # caller. - if(NOT ZEPHYR_CURRENT_MODULE_DIR) - message(FATAL_ERROR "Function only available for Zephyr modules.") - endif() + if(${ARGC} GREATER 0) + set(ZEPHYR_CURRENT_LIBRARY ${ARGV1}) + else() + # This is a macro because we need to ensure the ZEPHYR_CURRENT_LIBRARY and + # following zephyr_library_* calls are executed within the scope of the + # caller. + if(NOT ZEPHYR_CURRENT_MODULE_DIR) + message(FATAL_ERROR "Function only available for Zephyr modules.") + endif() - zephyr_library_get_current_dir_lib_name(${ZEPHYR_CURRENT_MODULE_DIR} lib_name) + zephyr_library_get_current_dir_lib_name(${ZEPHYR_CURRENT_MODULE_DIR} lib_name) - set(ZEPHYR_CURRENT_LIBRARY ${lib_name}) + set(ZEPHYR_CURRENT_LIBRARY ${lib_name}) + endif() endmacro() function(zephyr_link_interface interface) diff --git a/drivers/pinmux/CMakeLists.txt b/drivers/pinmux/CMakeLists.txt index b8c7fd532bd822..484230e8b979d6 100644 --- a/drivers/pinmux/CMakeLists.txt +++ b/drivers/pinmux/CMakeLists.txt @@ -1,6 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() +if(TARGET pinmux) + zephyr_library_amend(pinmux) +else() + zephyr_library_named(pinmux) +endif() + # Board initialization zephyr_library_sources_ifdef(CONFIG_PINMUX_CC13XX_CC26XX pinmux_cc13xx_cc26xx.c)