From b0db28b512c8306c88f3240dc8da1a1f4e79377a Mon Sep 17 00:00:00 2001 From: Adithya Baglody Date: Wed, 28 Mar 2018 15:36:12 +0530 Subject: [PATCH] drivers: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for driver files. Normally a syscall would check the current privilege level and then decide to go to _impl_ directly or go through a _handler_. __ZEPHYR_SUPERVISOR__ is a compiler optimization flag which will make all the system calls from the driver files directly link to the _impl_. Thereby reducing the overhead of checking the privileges. In the previous implementation all the source files would be compiled by zephyr_source() rule. This means that zephyr_* is a catchall CMake library for source files that can be built purely with the include paths, defines, and other compiler flags that all zephyr source files uses. This states that adding one extra compiler flag for only one complete directory would fail. This limitation can be overcome by using zephyr_libray* APIs. This creates a library for the required directories and it also supports directory level properties. Hence we use zephyr_library* to create a new library with macro _ZEPHYR_SUPERVISOR_ for the optimization. Signed-off-by: Adithya Baglody --- drivers/CMakeLists.txt | 2 + drivers/adc/CMakeLists.txt | 16 ++++--- drivers/aio/CMakeLists.txt | 6 ++- drivers/counter/CMakeLists.txt | 16 ++++--- drivers/dma/CMakeLists.txt | 14 +++--- drivers/entropy/CMakeLists.txt | 16 ++++--- drivers/flash/CMakeLists.txt | 28 ++++++------ drivers/gpio/CMakeLists.txt | 52 +++++++++++----------- drivers/i2c/CMakeLists.txt | 36 ++++++++------- drivers/i2s/CMakeLists.txt | 6 ++- drivers/ipm/CMakeLists.txt | 6 ++- drivers/pwm/CMakeLists.txt | 18 ++++---- drivers/rtc/CMakeLists.txt | 6 ++- drivers/sensor/CMakeLists.txt | 3 +- drivers/sensor/adxl362/CMakeLists.txt | 4 +- drivers/sensor/ak8975/CMakeLists.txt | 4 +- drivers/sensor/amg88xx/CMakeLists.txt | 6 ++- drivers/sensor/apds9960/CMakeLists.txt | 4 +- drivers/sensor/bma280/CMakeLists.txt | 6 ++- drivers/sensor/bmc150_magn/CMakeLists.txt | 6 ++- drivers/sensor/bme280/CMakeLists.txt | 4 +- drivers/sensor/bmg160/CMakeLists.txt | 6 ++- drivers/sensor/bmi160/CMakeLists.txt | 6 ++- drivers/sensor/ccs811/CMakeLists.txt | 4 +- drivers/sensor/dht/CMakeLists.txt | 4 +- drivers/sensor/fxas21002/CMakeLists.txt | 5 ++- drivers/sensor/fxos8700/CMakeLists.txt | 5 ++- drivers/sensor/hdc1008/CMakeLists.txt | 4 +- drivers/sensor/hmc5883l/CMakeLists.txt | 6 ++- drivers/sensor/hp206c/CMakeLists.txt | 4 +- drivers/sensor/hts221/CMakeLists.txt | 6 ++- drivers/sensor/isl29035/CMakeLists.txt | 6 ++- drivers/sensor/lis2dh/CMakeLists.txt | 6 ++- drivers/sensor/lis3dh/CMakeLists.txt | 6 ++- drivers/sensor/lis3mdl/CMakeLists.txt | 6 ++- drivers/sensor/lps22hb/CMakeLists.txt | 4 +- drivers/sensor/lps25hb/CMakeLists.txt | 4 +- drivers/sensor/lsm6ds0/CMakeLists.txt | 4 +- drivers/sensor/lsm6dsl/CMakeLists.txt | 12 ++--- drivers/sensor/lsm9ds0_gyro/CMakeLists.txt | 6 ++- drivers/sensor/lsm9ds0_mfd/CMakeLists.txt | 4 +- drivers/sensor/max30101/CMakeLists.txt | 3 +- drivers/sensor/max44009/CMakeLists.txt | 4 +- drivers/sensor/mcp9808/CMakeLists.txt | 6 ++- drivers/sensor/mpu6050/CMakeLists.txt | 6 ++- drivers/sensor/nrf5/CMakeLists.txt | 4 +- drivers/sensor/pms7003/CMakeLists.txt | 4 +- drivers/sensor/sht3xd/CMakeLists.txt | 6 ++- drivers/sensor/sx9500/CMakeLists.txt | 6 ++- drivers/sensor/th02/CMakeLists.txt | 4 +- drivers/sensor/tmp007/CMakeLists.txt | 6 ++- drivers/sensor/tmp112/CMakeLists.txt | 4 +- drivers/sensor/vl53l0x/CMakeLists.txt | 4 +- drivers/serial/CMakeLists.txt | 48 ++++++++++---------- drivers/spi/CMakeLists.txt | 20 +++++---- 55 files changed, 299 insertions(+), 193 deletions(-) diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index ecfc0c7ed04..d9360c1ec5a 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-D__ZEPHYR_SUPERVISOR__) + add_subdirectory(console) add_subdirectory(display) add_subdirectory(interrupt_controller) diff --git a/drivers/adc/CMakeLists.txt b/drivers/adc/CMakeLists.txt index 59776fb541d..787145630d3 100644 --- a/drivers/adc/CMakeLists.txt +++ b/drivers/adc/CMakeLists.txt @@ -1,8 +1,10 @@ -zephyr_sources_ifdef(CONFIG_ADC_DW adc_dw.c) -zephyr_sources_ifdef(CONFIG_ADC_MCUX_ADC16 adc_mcux_adc16.c) -zephyr_sources_ifdef(CONFIG_ADC_QMSI adc_qmsi.c) -zephyr_sources_ifdef(CONFIG_ADC_QMSI_SS adc_qmsi_ss.c) -zephyr_sources_ifdef(CONFIG_ADC_SAM_AFEC adc_sam_afec.c) -zephyr_sources_ifdef(CONFIG_ADC_TI_ADC108S102 adc_ti_adc108s102.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE adc_handlers.c) +zephyr_library_sources_ifdef(CONFIG_ADC_DW adc_dw.c) +zephyr_library_sources_ifdef(CONFIG_ADC_MCUX_ADC16 adc_mcux_adc16.c) +zephyr_library_sources_ifdef(CONFIG_ADC_QMSI adc_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_ADC_QMSI_SS adc_qmsi_ss.c) +zephyr_library_sources_ifdef(CONFIG_ADC_SAM_AFEC adc_sam_afec.c) +zephyr_library_sources_ifdef(CONFIG_ADC_TI_ADC108S102 adc_ti_adc108s102.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE adc_handlers.c) diff --git a/drivers/aio/CMakeLists.txt b/drivers/aio/CMakeLists.txt index 8f1344e5226..b0743ead7de 100644 --- a/drivers/aio/CMakeLists.txt +++ b/drivers/aio/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_AIO_COMPARATOR_QMSI aio_comparator_qmsi.c) -zephyr_sources_ifdef(CONFIG_USERSPACE aio_comparator_handlers.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_AIO_COMPARATOR_QMSI aio_comparator_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE aio_comparator_handlers.c) diff --git a/drivers/counter/CMakeLists.txt b/drivers/counter/CMakeLists.txt index d4759206e9e..7a138b29849 100644 --- a/drivers/counter/CMakeLists.txt +++ b/drivers/counter/CMakeLists.txt @@ -1,8 +1,10 @@ -zephyr_sources_ifdef(CONFIG_AON_COUNTER_QMSI counter_qmsi_aon.c) -zephyr_sources_ifdef(CONFIG_AON_TIMER_QMSI counter_qmsi_aonpt.c) -zephyr_sources_ifdef(CONFIG_COUNTER_TMR_CMSDK_APB counter_tmr_cmsdk_apb.c) -zephyr_sources_ifdef(CONFIG_TIMER_TMR_CMSDK_APB timer_tmr_cmsdk_apb.c) -zephyr_sources_ifdef(CONFIG_COUNTER_DTMR_CMSDK_APB counter_dtmr_cmsdk_apb.c) -zephyr_sources_ifdef(CONFIG_TIMER_DTMR_CMSDK_APB timer_dtmr_cmsdk_apb.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE counter_handlers.c) +zephyr_library_sources_ifdef(CONFIG_AON_COUNTER_QMSI counter_qmsi_aon.c) +zephyr_library_sources_ifdef(CONFIG_AON_TIMER_QMSI counter_qmsi_aonpt.c) +zephyr_library_sources_ifdef(CONFIG_COUNTER_TMR_CMSDK_APB counter_tmr_cmsdk_apb.c) +zephyr_library_sources_ifdef(CONFIG_TIMER_TMR_CMSDK_APB timer_tmr_cmsdk_apb.c) +zephyr_library_sources_ifdef(CONFIG_COUNTER_DTMR_CMSDK_APB counter_dtmr_cmsdk_apb.c) +zephyr_library_sources_ifdef(CONFIG_TIMER_DTMR_CMSDK_APB timer_dtmr_cmsdk_apb.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE counter_handlers.c) diff --git a/drivers/dma/CMakeLists.txt b/drivers/dma/CMakeLists.txt index d47ee4b49f2..eda4cdcab68 100644 --- a/drivers/dma/CMakeLists.txt +++ b/drivers/dma/CMakeLists.txt @@ -1,6 +1,8 @@ -zephyr_sources_ifdef(CONFIG_DMA_QMSI dma_qmsi.c) -zephyr_sources_ifdef(CONFIG_DMA_SAM_XDMAC dma_sam_xdmac.c) -zephyr_sources_ifdef(CONFIG_DMA_STM32F4X dma_stm32f4x.c) -zephyr_sources_ifdef(CONFIG_DMA_CAVS dma_cavs.c) -zephyr_sources_ifdef(CONFIG_DMA_NIOS2_MSGDMA dma_nios2_msgdma.c) -zephyr_sources_ifdef(CONFIG_USERSPACE dma_handlers.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_DMA_QMSI dma_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_DMA_SAM_XDMAC dma_sam_xdmac.c) +zephyr_library_sources_ifdef(CONFIG_DMA_STM32F4X dma_stm32f4x.c) +zephyr_library_sources_ifdef(CONFIG_DMA_CAVS dma_cavs.c) +zephyr_library_sources_ifdef(CONFIG_DMA_NIOS2_MSGDMA dma_nios2_msgdma.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE dma_handlers.c) diff --git a/drivers/entropy/CMakeLists.txt b/drivers/entropy/CMakeLists.txt index 801bc1a7c8f..6e48b32eb48 100644 --- a/drivers/entropy/CMakeLists.txt +++ b/drivers/entropy/CMakeLists.txt @@ -1,7 +1,9 @@ -zephyr_sources_ifdef(CONFIG_ENTROPY_ESP32_RNG entropy_esp32.c) -zephyr_sources_ifdef(CONFIG_ENTROPY_MCUX_RNGA entropy_mcux_rnga.c) -zephyr_sources_ifdef(CONFIG_ENTROPY_MCUX_TRNG entropy_mcux_trng.c) -zephyr_sources_ifdef(CONFIG_ENTROPY_NRF5_RNG entropy_nrf5.c) -zephyr_sources_ifdef(CONFIG_ENTROPY_STM32_RNG entropy_stm32.c) -zephyr_sources_ifdef(CONFIG_ENTROPY_NATIVE_POSIX entropy_native_posix.c) -zephyr_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c) +zephyr_library_ifdef(CONFIG_ENTROPY_HAS_DRIVER) + +zephyr_library_sources_ifdef(CONFIG_ENTROPY_ESP32_RNG entropy_esp32.c) +zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_RNGA entropy_mcux_rnga.c) +zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_TRNG entropy_mcux_trng.c) +zephyr_library_sources_ifdef(CONFIG_ENTROPY_NRF5_RNG entropy_nrf5.c) +zephyr_library_sources_ifdef(CONFIG_ENTROPY_STM32_RNG entropy_stm32.c) +zephyr_library_sources_ifdef(CONFIG_ENTROPY_NATIVE_POSIX entropy_native_posix.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c) diff --git a/drivers/flash/CMakeLists.txt b/drivers/flash/CMakeLists.txt index bdb1891b465..142fd32a32f 100644 --- a/drivers/flash/CMakeLists.txt +++ b/drivers/flash/CMakeLists.txt @@ -1,33 +1,35 @@ -zephyr_sources_ifdef(CONFIG_SPI_FLASH_W25QXXDV spi_flash_w25qxxdv.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_QMSI soc_flash_qmsi.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_NRF soc_flash_nrf.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_MCUX soc_flash_mcux.c) -zephyr_sources_ifdef(CONFIG_FLASH_PAGE_LAYOUT flash_page_layout.c) -zephyr_sources_ifdef(CONFIG_USERSPACE flash_handlers.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_SAM0 flash_sam0.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_NIOS2_QSPI soc_flash_nios2_qspi.c) +zephyr_library_ifdef(CONFIG_FLASH_HAS_DRIVER_ENABLED) + +zephyr_library_sources_ifdef(CONFIG_SPI_FLASH_W25QXXDV spi_flash_w25qxxdv.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_QMSI soc_flash_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NRF soc_flash_nrf.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_MCUX soc_flash_mcux.c) +zephyr_library_sources_ifdef(CONFIG_FLASH_PAGE_LAYOUT flash_page_layout.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE flash_handlers.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SAM0 flash_sam0.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NIOS2_QSPI soc_flash_nios2_qspi.c) if(CONFIG_SOC_SERIES_STM32F0X) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32 +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32.c flash_stm32f0x.c ) endif() if(CONFIG_SOC_SERIES_STM32F3X) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32f3x.c) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32f3x_priv.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32f3x.c) +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32f3x_priv.c) endif() if(CONFIG_SOC_SERIES_STM32F4X) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32 +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32.c flash_stm32f4x.c ) endif() if(CONFIG_SOC_SERIES_STM32L4X) -zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32 +zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32 flash_stm32.c flash_stm32l4x.c ) diff --git a/drivers/gpio/CMakeLists.txt b/drivers/gpio/CMakeLists.txt index a7ab8bc81bf..06a3bae35c7 100644 --- a/drivers/gpio/CMakeLists.txt +++ b/drivers/gpio/CMakeLists.txt @@ -1,26 +1,28 @@ -zephyr_sources_ifdef(CONFIG_GPIO_ALTERA_NIOS2 gpio_altera_nios2.c) -zephyr_sources_ifdef(CONFIG_GPIO_ATMEL_SAM3 gpio_atmel_sam3.c) -zephyr_sources_ifdef(CONFIG_GPIO_CC2650 gpio_cc2650.c) -zephyr_sources_ifdef(CONFIG_GPIO_CC32XX gpio_cc32xx.c) -zephyr_sources_ifdef(CONFIG_GPIO_CMSDK_AHB gpio_cmsdk_ahb.c) -zephyr_sources_ifdef(CONFIG_GPIO_DW gpio_dw.c) -zephyr_sources_ifdef(CONFIG_GPIO_ESP32 gpio_esp32.c) -zephyr_sources_ifdef(CONFIG_GPIO_FE310 gpio_fe310.c) -zephyr_sources_ifdef(CONFIG_GPIO_GECKO gpio_gecko.c) -zephyr_sources_ifdef(CONFIG_GPIO_IMX gpio_imx.c) -zephyr_sources_ifdef(CONFIG_GPIO_MCUX gpio_mcux.c) -zephyr_sources_ifdef(CONFIG_GPIO_MCUX_IGPIO gpio_mcux_igpio.c) -zephyr_sources_ifdef(CONFIG_GPIO_MCUX_LPC gpio_mcux_lpc.c) -zephyr_sources_ifdef(CONFIG_GPIO_MMIO32 gpio_mmio32.c) -zephyr_sources_ifdef(CONFIG_GPIO_NRF5 gpio_nrf5.c) -zephyr_sources_ifdef(CONFIG_GPIO_PCAL9535A gpio_pcal9535a.c) -zephyr_sources_ifdef(CONFIG_GPIO_PULPINO gpio_pulpino.c) -zephyr_sources_ifdef(CONFIG_GPIO_QMSI gpio_qmsi.c) -zephyr_sources_ifdef(CONFIG_GPIO_QMSI_SS gpio_qmsi_ss.c) -zephyr_sources_ifdef(CONFIG_GPIO_SCH gpio_sch.c) -zephyr_sources_ifdef(CONFIG_GPIO_STM32 gpio_stm32.c) -zephyr_sources_ifdef(CONFIG_GPIO_SAM0 gpio_sam0.c) -zephyr_sources_ifdef(CONFIG_GPIO_SAM gpio_sam.c) -zephyr_sources_ifdef(CONFIG_GPIO_SX1509B gpio_sx1509b.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE gpio_handlers.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_ALTERA_NIOS2 gpio_altera_nios2.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_ATMEL_SAM3 gpio_atmel_sam3.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_CC2650 gpio_cc2650.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_CC32XX gpio_cc32xx.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_CMSDK_AHB gpio_cmsdk_ahb.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_DW gpio_dw.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_ESP32 gpio_esp32.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_FE310 gpio_fe310.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_GECKO gpio_gecko.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_IMX gpio_imx.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX gpio_mcux.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_IGPIO gpio_mcux_igpio.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_MCUX_LPC gpio_mcux_lpc.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_MMIO32 gpio_mmio32.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_NRF5 gpio_nrf5.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_PCAL9535A gpio_pcal9535a.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_PULPINO gpio_pulpino.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_QMSI gpio_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_QMSI_SS gpio_qmsi_ss.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_SCH gpio_sch.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_STM32 gpio_stm32.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_SAM0 gpio_sam0.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_SAM gpio_sam.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_SX1509B gpio_sx1509b.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE gpio_handlers.c) diff --git a/drivers/i2c/CMakeLists.txt b/drivers/i2c/CMakeLists.txt index c8ee3b65e7f..7aa59137c96 100644 --- a/drivers/i2c/CMakeLists.txt +++ b/drivers/i2c/CMakeLists.txt @@ -1,25 +1,27 @@ -zephyr_sources_ifdef(CONFIG_I2C_ATMEL_SAM3 i2c_atmel_sam3.c) -zephyr_sources_ifdef(CONFIG_I2C_BITBANG i2c_bitbang.c) -zephyr_sources_ifdef(CONFIG_I2C_CC32XX i2c_cc32xx.c) -zephyr_sources_ifdef(CONFIG_I2C_DW i2c_dw.c) -zephyr_sources_ifdef(CONFIG_I2C_ESP32 i2c_esp32.c) -zephyr_sources_ifdef(CONFIG_I2C_GPIO i2c_gpio.c) -zephyr_sources_ifdef(CONFIG_I2C_MCUX i2c_mcux.c) -zephyr_sources_ifdef(CONFIG_I2C_NRF5 i2c_nrf5.c) -zephyr_sources_ifdef(CONFIG_I2C_QMSI i2c_qmsi.c) -zephyr_sources_ifdef(CONFIG_I2C_QMSI_SS i2c_qmsi_ss.c) -zephyr_sources_ifdef(CONFIG_I2C_SAM_TWI i2c_sam_twi.c) -zephyr_sources_ifdef(CONFIG_I2C_SAM_TWIHS i2c_sam_twihs.c) -zephyr_sources_ifdef(CONFIG_I2C_SBCON i2c_sbcon.c) -zephyr_sources_ifdef(CONFIG_I2C_NIOS2 i2c_nios2.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_I2C_STM32_V1 +zephyr_library_sources_ifdef(CONFIG_I2C_ATMEL_SAM3 i2c_atmel_sam3.c) +zephyr_library_sources_ifdef(CONFIG_I2C_BITBANG i2c_bitbang.c) +zephyr_library_sources_ifdef(CONFIG_I2C_CC32XX i2c_cc32xx.c) +zephyr_library_sources_ifdef(CONFIG_I2C_DW i2c_dw.c) +zephyr_library_sources_ifdef(CONFIG_I2C_ESP32 i2c_esp32.c) +zephyr_library_sources_ifdef(CONFIG_I2C_GPIO i2c_gpio.c) +zephyr_library_sources_ifdef(CONFIG_I2C_MCUX i2c_mcux.c) +zephyr_library_sources_ifdef(CONFIG_I2C_NRF5 i2c_nrf5.c) +zephyr_library_sources_ifdef(CONFIG_I2C_QMSI i2c_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_I2C_QMSI_SS i2c_qmsi_ss.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWI i2c_sam_twi.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS i2c_sam_twihs.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SBCON i2c_sbcon.c) +zephyr_library_sources_ifdef(CONFIG_I2C_NIOS2 i2c_nios2.c) + +zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V1 i2c_ll_stm32_v1.c i2c_ll_stm32.c ) -zephyr_sources_ifdef(CONFIG_I2C_STM32_V2 +zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V2 i2c_ll_stm32_v2.c i2c_ll_stm32.c ) -zephyr_sources_ifdef(CONFIG_USERSPACE i2c_handlers.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE i2c_handlers.c) diff --git a/drivers/i2s/CMakeLists.txt b/drivers/i2s/CMakeLists.txt index d6ceb186804..a37c8c6c7a2 100644 --- a/drivers/i2s/CMakeLists.txt +++ b/drivers/i2s/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_I2S_SAM_SSC i2s_sam_ssc.c) -zephyr_sources_ifdef(CONFIG_I2S_CAVS i2s_cavs.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_I2S_SAM_SSC i2s_sam_ssc.c) +zephyr_library_sources_ifdef(CONFIG_I2S_CAVS i2s_cavs.c) diff --git a/drivers/ipm/CMakeLists.txt b/drivers/ipm/CMakeLists.txt index 4ddb74798c3..bbff9cca1c1 100644 --- a/drivers/ipm/CMakeLists.txt +++ b/drivers/ipm/CMakeLists.txt @@ -1,3 +1,5 @@ -zephyr_sources_ifdef(CONFIG_IPM_QUARK_SE ipm_quark_se.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE ipm_handlers.c) +zephyr_library_sources_ifdef(CONFIG_IPM_QUARK_SE ipm_quark_se.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE ipm_handlers.c) diff --git a/drivers/pwm/CMakeLists.txt b/drivers/pwm/CMakeLists.txt index e89aac97114..faf77fd69d2 100644 --- a/drivers/pwm/CMakeLists.txt +++ b/drivers/pwm/CMakeLists.txt @@ -1,9 +1,11 @@ -zephyr_sources_ifdef(CONFIG_PWM_PCA9685 pwm_pca9685.c) -zephyr_sources_ifdef(CONFIG_PWM_DW pwm_dw.c) -zephyr_sources_ifdef(CONFIG_PWM_QMSI pwm_qmsi.c) -zephyr_sources_ifdef(CONFIG_PWM_STM32 pwm_stm32.c) -zephyr_sources_ifdef(CONFIG_PWM_NRF5_SW pwm_nrf5_sw.c) -zephyr_sources_ifdef(CONFIG_PWM_MCUX_FTM pwm_mcux_ftm.c) -zephyr_sources_ifdef(CONFIG_PWM_LED_ESP32 pwm_led_esp32.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE pwm_handlers.c) +zephyr_library_sources_ifdef(CONFIG_PWM_PCA9685 pwm_pca9685.c) +zephyr_library_sources_ifdef(CONFIG_PWM_DW pwm_dw.c) +zephyr_library_sources_ifdef(CONFIG_PWM_QMSI pwm_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_PWM_STM32 pwm_stm32.c) +zephyr_library_sources_ifdef(CONFIG_PWM_NRF5_SW pwm_nrf5_sw.c) +zephyr_library_sources_ifdef(CONFIG_PWM_MCUX_FTM pwm_mcux_ftm.c) +zephyr_library_sources_ifdef(CONFIG_PWM_LED_ESP32 pwm_led_esp32.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE pwm_handlers.c) diff --git a/drivers/rtc/CMakeLists.txt b/drivers/rtc/CMakeLists.txt index 722f7bebc4f..a3de847a073 100644 --- a/drivers/rtc/CMakeLists.txt +++ b/drivers/rtc/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_RTC_QMSI rtc_qmsi.c) -zephyr_sources_ifdef(CONFIG_USERSPACE rtc_handlers.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_RTC_QMSI rtc_qmsi.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE rtc_handlers.c) diff --git a/drivers/sensor/CMakeLists.txt b/drivers/sensor/CMakeLists.txt index 0354430e37b..f042d345417 100644 --- a/drivers/sensor/CMakeLists.txt +++ b/drivers/sensor/CMakeLists.txt @@ -38,4 +38,5 @@ add_subdirectory_ifdef(CONFIG_TMP007 tmp007) add_subdirectory_ifdef(CONFIG_TMP112 tmp112) add_subdirectory_ifdef(CONFIG_VL53L0X vl53l0x) -zephyr_sources_ifdef(CONFIG_USERSPACE sensor_handlers.c) +zephyr_library_ifdef(CONFIG_USERSPACE) +zephyr_library_sources_ifdef(CONFIG_USERSPACE sensor_handlers.c) diff --git a/drivers/sensor/adxl362/CMakeLists.txt b/drivers/sensor/adxl362/CMakeLists.txt index 195e3c28526..c0a478d3e25 100644 --- a/drivers/sensor/adxl362/CMakeLists.txt +++ b/drivers/sensor/adxl362/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_ADXL362 adxl362.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_ADXL362 adxl362.c) diff --git a/drivers/sensor/ak8975/CMakeLists.txt b/drivers/sensor/ak8975/CMakeLists.txt index 3913d313412..0bac197d28a 100644 --- a/drivers/sensor/ak8975/CMakeLists.txt +++ b/drivers/sensor/ak8975/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_AK8975 ak8975.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_AK8975 ak8975.c) diff --git a/drivers/sensor/amg88xx/CMakeLists.txt b/drivers/sensor/amg88xx/CMakeLists.txt index 5d622c3190d..8db7d983086 100644 --- a/drivers/sensor/amg88xx/CMakeLists.txt +++ b/drivers/sensor/amg88xx/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_AMG88XX amg88xx.c) -zephyr_sources_ifdef(CONFIG_AMG88XX_TRIGGER amg88xx_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_AMG88XX amg88xx.c) +zephyr_library_sources_ifdef(CONFIG_AMG88XX_TRIGGER amg88xx_trigger.c) diff --git a/drivers/sensor/apds9960/CMakeLists.txt b/drivers/sensor/apds9960/CMakeLists.txt index 6a6ecb626a0..d9bac8ab633 100644 --- a/drivers/sensor/apds9960/CMakeLists.txt +++ b/drivers/sensor/apds9960/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_APDS9960 apds9960.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_APDS9960 apds9960.c) diff --git a/drivers/sensor/bma280/CMakeLists.txt b/drivers/sensor/bma280/CMakeLists.txt index 1372f736f4a..65e49a432f5 100644 --- a/drivers/sensor/bma280/CMakeLists.txt +++ b/drivers/sensor/bma280/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_BMA280 bma280.c) -zephyr_sources_ifdef(CONFIG_BMA280_TRIGGER bma280_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_BMA280 bma280.c) +zephyr_library_sources_ifdef(CONFIG_BMA280_TRIGGER bma280_trigger.c) diff --git a/drivers/sensor/bmc150_magn/CMakeLists.txt b/drivers/sensor/bmc150_magn/CMakeLists.txt index e175586ad7d..dc2d6cfa773 100644 --- a/drivers/sensor/bmc150_magn/CMakeLists.txt +++ b/drivers/sensor/bmc150_magn/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_BMC150_MAGN bmc150_magn.c) -zephyr_sources_ifdef(CONFIG_BMC150_MAGN_TRIGGER bmc150_magn_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_BMC150_MAGN bmc150_magn.c) +zephyr_library_sources_ifdef(CONFIG_BMC150_MAGN_TRIGGER bmc150_magn_trigger.c) diff --git a/drivers/sensor/bme280/CMakeLists.txt b/drivers/sensor/bme280/CMakeLists.txt index 4fc11b98485..53456485baf 100644 --- a/drivers/sensor/bme280/CMakeLists.txt +++ b/drivers/sensor/bme280/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_BME280 bme280.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_BME280 bme280.c) diff --git a/drivers/sensor/bmg160/CMakeLists.txt b/drivers/sensor/bmg160/CMakeLists.txt index 7e57d4ccc9a..d101fe0c70b 100644 --- a/drivers/sensor/bmg160/CMakeLists.txt +++ b/drivers/sensor/bmg160/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_BMG160 bmg160.c) -zephyr_sources_ifdef(CONFIG_BMG160_TRIGGER bmg160_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_BMG160 bmg160.c) +zephyr_library_sources_ifdef(CONFIG_BMG160_TRIGGER bmg160_trigger.c) diff --git a/drivers/sensor/bmi160/CMakeLists.txt b/drivers/sensor/bmi160/CMakeLists.txt index 3dc0197c1de..c6102a0ce95 100644 --- a/drivers/sensor/bmi160/CMakeLists.txt +++ b/drivers/sensor/bmi160/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_BMI160 bmi160.c) -zephyr_sources_ifdef(CONFIG_BMI160_TRIGGER bmi160_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_BMI160 bmi160.c) +zephyr_library_sources_ifdef(CONFIG_BMI160_TRIGGER bmi160_trigger.c) diff --git a/drivers/sensor/ccs811/CMakeLists.txt b/drivers/sensor/ccs811/CMakeLists.txt index 0c521e8a8c9..e6d027d4ab0 100644 --- a/drivers/sensor/ccs811/CMakeLists.txt +++ b/drivers/sensor/ccs811/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_CCS811 ccs811.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_CCS811 ccs811.c) diff --git a/drivers/sensor/dht/CMakeLists.txt b/drivers/sensor/dht/CMakeLists.txt index 8d30a9e4472..8876eadca35 100644 --- a/drivers/sensor/dht/CMakeLists.txt +++ b/drivers/sensor/dht/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_DHT dht.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_DHT dht.c) diff --git a/drivers/sensor/fxas21002/CMakeLists.txt b/drivers/sensor/fxas21002/CMakeLists.txt index acd1804996f..82cfbf89a13 100644 --- a/drivers/sensor/fxas21002/CMakeLists.txt +++ b/drivers/sensor/fxas21002/CMakeLists.txt @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 # +zephyr_library() -zephyr_sources_ifdef(CONFIG_FXAS21002 fxas21002.c) -zephyr_sources_ifdef(CONFIG_FXAS21002_TRIGGER fxas21002_trigger.c) +zephyr_library_sources_ifdef(CONFIG_FXAS21002 fxas21002.c) +zephyr_library_sources_ifdef(CONFIG_FXAS21002_TRIGGER fxas21002_trigger.c) diff --git a/drivers/sensor/fxos8700/CMakeLists.txt b/drivers/sensor/fxos8700/CMakeLists.txt index f168f1db911..b07f2afdb7d 100644 --- a/drivers/sensor/fxos8700/CMakeLists.txt +++ b/drivers/sensor/fxos8700/CMakeLists.txt @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 # +zephyr_library() -zephyr_sources_ifdef(CONFIG_FXOS8700 fxos8700.c) -zephyr_sources_ifdef(CONFIG_FXOS8700_TRIGGER fxos8700_trigger.c) +zephyr_library_sources_ifdef(CONFIG_FXOS8700 fxos8700.c) +zephyr_library_sources_ifdef(CONFIG_FXOS8700_TRIGGER fxos8700_trigger.c) diff --git a/drivers/sensor/hdc1008/CMakeLists.txt b/drivers/sensor/hdc1008/CMakeLists.txt index 7c43a23096d..69b428d4e35 100644 --- a/drivers/sensor/hdc1008/CMakeLists.txt +++ b/drivers/sensor/hdc1008/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_HDC1008 hdc1008.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_HDC1008 hdc1008.c) diff --git a/drivers/sensor/hmc5883l/CMakeLists.txt b/drivers/sensor/hmc5883l/CMakeLists.txt index 80d11274e8e..6071656c319 100644 --- a/drivers/sensor/hmc5883l/CMakeLists.txt +++ b/drivers/sensor/hmc5883l/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_HMC5883L hmc5883l.c) -zephyr_sources_ifdef(CONFIG_HMC5883L_TRIGGER hmc5883l_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_HMC5883L hmc5883l.c) +zephyr_library_sources_ifdef(CONFIG_HMC5883L_TRIGGER hmc5883l_trigger.c) diff --git a/drivers/sensor/hp206c/CMakeLists.txt b/drivers/sensor/hp206c/CMakeLists.txt index d81e88cbbf7..af4b5c2cee9 100644 --- a/drivers/sensor/hp206c/CMakeLists.txt +++ b/drivers/sensor/hp206c/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_HP206C hp206c.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_HP206C hp206c.c) diff --git a/drivers/sensor/hts221/CMakeLists.txt b/drivers/sensor/hts221/CMakeLists.txt index c6290b398e4..3afa3d9e574 100644 --- a/drivers/sensor/hts221/CMakeLists.txt +++ b/drivers/sensor/hts221/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_HTS221 hts221.c) -zephyr_sources_ifdef(CONFIG_HTS221_TRIGGER hts221_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_HTS221 hts221.c) +zephyr_library_sources_ifdef(CONFIG_HTS221_TRIGGER hts221_trigger.c) diff --git a/drivers/sensor/isl29035/CMakeLists.txt b/drivers/sensor/isl29035/CMakeLists.txt index 39ddccea8b4..1fd56e03108 100644 --- a/drivers/sensor/isl29035/CMakeLists.txt +++ b/drivers/sensor/isl29035/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_ISL29035 isl29035.c) -zephyr_sources_ifdef(CONFIG_ISL29035_TRIGGER isl29035_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_ISL29035 isl29035.c) +zephyr_library_sources_ifdef(CONFIG_ISL29035_TRIGGER isl29035_trigger.c) diff --git a/drivers/sensor/lis2dh/CMakeLists.txt b/drivers/sensor/lis2dh/CMakeLists.txt index 25dc19ff378..04a2363c2bb 100644 --- a/drivers/sensor/lis2dh/CMakeLists.txt +++ b/drivers/sensor/lis2dh/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_LIS2DH lis2dh.c) -zephyr_sources_ifdef(CONFIG_LIS2DH_TRIGGER lis2dh_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LIS2DH lis2dh.c) +zephyr_library_sources_ifdef(CONFIG_LIS2DH_TRIGGER lis2dh_trigger.c) diff --git a/drivers/sensor/lis3dh/CMakeLists.txt b/drivers/sensor/lis3dh/CMakeLists.txt index 59111af7326..5e61cd27bef 100644 --- a/drivers/sensor/lis3dh/CMakeLists.txt +++ b/drivers/sensor/lis3dh/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_LIS3DH lis3dh.c) -zephyr_sources_ifdef(CONFIG_LIS3DH_TRIGGER lis3dh_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LIS3DH lis3dh.c) +zephyr_library_sources_ifdef(CONFIG_LIS3DH_TRIGGER lis3dh_trigger.c) diff --git a/drivers/sensor/lis3mdl/CMakeLists.txt b/drivers/sensor/lis3mdl/CMakeLists.txt index 645adada76d..b12e9e3a4c4 100644 --- a/drivers/sensor/lis3mdl/CMakeLists.txt +++ b/drivers/sensor/lis3mdl/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_LIS3MDL lis3mdl.c) -zephyr_sources_ifdef(CONFIG_LIS3MDL_TRIGGER lis3mdl_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LIS3MDL lis3mdl.c) +zephyr_library_sources_ifdef(CONFIG_LIS3MDL_TRIGGER lis3mdl_trigger.c) diff --git a/drivers/sensor/lps22hb/CMakeLists.txt b/drivers/sensor/lps22hb/CMakeLists.txt index df0a2b98f17..eecbef0f365 100644 --- a/drivers/sensor/lps22hb/CMakeLists.txt +++ b/drivers/sensor/lps22hb/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_LPS22HB lps22hb.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LPS22HB lps22hb.c) diff --git a/drivers/sensor/lps25hb/CMakeLists.txt b/drivers/sensor/lps25hb/CMakeLists.txt index fe3649859b6..faf270ae559 100644 --- a/drivers/sensor/lps25hb/CMakeLists.txt +++ b/drivers/sensor/lps25hb/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_LPS25HB lps25hb.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LPS25HB lps25hb.c) diff --git a/drivers/sensor/lsm6ds0/CMakeLists.txt b/drivers/sensor/lsm6ds0/CMakeLists.txt index e6de309855b..9ecf8995e9d 100644 --- a/drivers/sensor/lsm6ds0/CMakeLists.txt +++ b/drivers/sensor/lsm6ds0/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_LSM6DS0 lsm6ds0.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LSM6DS0 lsm6ds0.c) diff --git a/drivers/sensor/lsm6dsl/CMakeLists.txt b/drivers/sensor/lsm6dsl/CMakeLists.txt index d9f18f0ac40..b42cba8f09e 100644 --- a/drivers/sensor/lsm6dsl/CMakeLists.txt +++ b/drivers/sensor/lsm6dsl/CMakeLists.txt @@ -1,5 +1,7 @@ -zephyr_sources_ifdef(CONFIG_LSM6DSL lsm6dsl.c) -zephyr_sources_ifdef(CONFIG_LSM6DSL_SPI lsm6dsl_spi.c) -zephyr_sources_ifdef(CONFIG_LSM6DSL_I2C lsm6dsl_i2c.c) -zephyr_sources_ifdef(CONFIG_LSM6DSL_TRIGGER lsm6dsl_trigger.c) -zephyr_sources_ifdef(CONFIG_LSM6DSL_SENSORHUB lsm6dsl_shub.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LSM6DSL lsm6dsl.c) +zephyr_library_sources_ifdef(CONFIG_LSM6DSL_SPI lsm6dsl_spi.c) +zephyr_library_sources_ifdef(CONFIG_LSM6DSL_I2C lsm6dsl_i2c.c) +zephyr_library_sources_ifdef(CONFIG_LSM6DSL_TRIGGER lsm6dsl_trigger.c) +zephyr_library_sources_ifdef(CONFIG_LSM6DSL_SENSORHUB lsm6dsl_shub.c) diff --git a/drivers/sensor/lsm9ds0_gyro/CMakeLists.txt b/drivers/sensor/lsm9ds0_gyro/CMakeLists.txt index bed94f8944d..67a4c3b3881 100644 --- a/drivers/sensor/lsm9ds0_gyro/CMakeLists.txt +++ b/drivers/sensor/lsm9ds0_gyro/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_LSM9DS0_GYRO lsm9ds0_gyro.c) -zephyr_sources_ifdef(CONFIG_LSM9DS0_GYRO_TRIGGER_DRDY lsm9ds0_gyro_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LSM9DS0_GYRO lsm9ds0_gyro.c) +zephyr_library_sources_ifdef(CONFIG_LSM9DS0_GYRO_TRIGGER_DRDY lsm9ds0_gyro_trigger.c) diff --git a/drivers/sensor/lsm9ds0_mfd/CMakeLists.txt b/drivers/sensor/lsm9ds0_mfd/CMakeLists.txt index fec4edad321..16ffe4e01e2 100644 --- a/drivers/sensor/lsm9ds0_mfd/CMakeLists.txt +++ b/drivers/sensor/lsm9ds0_mfd/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_LSM9DS0_MFD lsm9ds0_mfd.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_LSM9DS0_MFD lsm9ds0_mfd.c) diff --git a/drivers/sensor/max30101/CMakeLists.txt b/drivers/sensor/max30101/CMakeLists.txt index 6a06728a063..f3799d521b9 100644 --- a/drivers/sensor/max30101/CMakeLists.txt +++ b/drivers/sensor/max30101/CMakeLists.txt @@ -4,5 +4,6 @@ # # SPDX-License-Identifier: Apache-2.0 # +zephyr_library() -zephyr_sources_ifdef(CONFIG_MAX30101 max30101.c) +zephyr_library_sources_ifdef(CONFIG_MAX30101 max30101.c) diff --git a/drivers/sensor/max44009/CMakeLists.txt b/drivers/sensor/max44009/CMakeLists.txt index 1e1cf7049ab..cad52ed4490 100644 --- a/drivers/sensor/max44009/CMakeLists.txt +++ b/drivers/sensor/max44009/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_MAX44009 max44009.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_MAX44009 max44009.c) diff --git a/drivers/sensor/mcp9808/CMakeLists.txt b/drivers/sensor/mcp9808/CMakeLists.txt index a91ed4161a6..cf357df213d 100644 --- a/drivers/sensor/mcp9808/CMakeLists.txt +++ b/drivers/sensor/mcp9808/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_MCP9808 mcp9808.c) -zephyr_sources_ifdef(CONFIG_MCP9808_TRIGGER mcp9808_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_MCP9808 mcp9808.c) +zephyr_library_sources_ifdef(CONFIG_MCP9808_TRIGGER mcp9808_trigger.c) diff --git a/drivers/sensor/mpu6050/CMakeLists.txt b/drivers/sensor/mpu6050/CMakeLists.txt index a7849708bbd..40f29c01e47 100644 --- a/drivers/sensor/mpu6050/CMakeLists.txt +++ b/drivers/sensor/mpu6050/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_MPU6050 mpu6050.c) -zephyr_sources_ifdef(CONFIG_MPU6050_TRIGGER mpu6050_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_MPU6050 mpu6050.c) +zephyr_library_sources_ifdef(CONFIG_MPU6050_TRIGGER mpu6050_trigger.c) diff --git a/drivers/sensor/nrf5/CMakeLists.txt b/drivers/sensor/nrf5/CMakeLists.txt index 3655e238164..34f726921d4 100644 --- a/drivers/sensor/nrf5/CMakeLists.txt +++ b/drivers/sensor/nrf5/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_TEMP_NRF5 temp_nrf5.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_TEMP_NRF5 temp_nrf5.c) diff --git a/drivers/sensor/pms7003/CMakeLists.txt b/drivers/sensor/pms7003/CMakeLists.txt index c6c87c5d817..01332d34a32 100644 --- a/drivers/sensor/pms7003/CMakeLists.txt +++ b/drivers/sensor/pms7003/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_PMS7003 pms7003.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_PMS7003 pms7003.c) diff --git a/drivers/sensor/sht3xd/CMakeLists.txt b/drivers/sensor/sht3xd/CMakeLists.txt index b79e6ec7967..fdc8ad0e45e 100644 --- a/drivers/sensor/sht3xd/CMakeLists.txt +++ b/drivers/sensor/sht3xd/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_SHT3XD sht3xd.c) -zephyr_sources_ifdef(CONFIG_SHT3XD_TRIGGER sht3xd_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_SHT3XD sht3xd.c) +zephyr_library_sources_ifdef(CONFIG_SHT3XD_TRIGGER sht3xd_trigger.c) diff --git a/drivers/sensor/sx9500/CMakeLists.txt b/drivers/sensor/sx9500/CMakeLists.txt index 5bb5c20b0bc..334b715c278 100644 --- a/drivers/sensor/sx9500/CMakeLists.txt +++ b/drivers/sensor/sx9500/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_SX9500 sx9500.c) -zephyr_sources_ifdef(CONFIG_SX9500_TRIGGER sx9500_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_SX9500 sx9500.c) +zephyr_library_sources_ifdef(CONFIG_SX9500_TRIGGER sx9500_trigger.c) diff --git a/drivers/sensor/th02/CMakeLists.txt b/drivers/sensor/th02/CMakeLists.txt index aca64052763..3ce4ded71a4 100644 --- a/drivers/sensor/th02/CMakeLists.txt +++ b/drivers/sensor/th02/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources(th02.c) +zephyr_library() + +zephyr_library_sources(th02.c) diff --git a/drivers/sensor/tmp007/CMakeLists.txt b/drivers/sensor/tmp007/CMakeLists.txt index af4b732eb72..ad8b5d8fb9e 100644 --- a/drivers/sensor/tmp007/CMakeLists.txt +++ b/drivers/sensor/tmp007/CMakeLists.txt @@ -1,2 +1,4 @@ -zephyr_sources_ifdef(CONFIG_TMP007 tmp007.c) -zephyr_sources_ifdef(CONFIG_TMP007_TRIGGER tmp007_trigger.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_TMP007 tmp007.c) +zephyr_library_sources_ifdef(CONFIG_TMP007_TRIGGER tmp007_trigger.c) diff --git a/drivers/sensor/tmp112/CMakeLists.txt b/drivers/sensor/tmp112/CMakeLists.txt index 1e843d8b502..8c7b385dac4 100644 --- a/drivers/sensor/tmp112/CMakeLists.txt +++ b/drivers/sensor/tmp112/CMakeLists.txt @@ -1 +1,3 @@ -zephyr_sources_ifdef(CONFIG_TMP112 tmp112.c) +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_TMP112 tmp112.c) diff --git a/drivers/sensor/vl53l0x/CMakeLists.txt b/drivers/sensor/vl53l0x/CMakeLists.txt index 165abb49cdf..7d999437547 100644 --- a/drivers/sensor/vl53l0x/CMakeLists.txt +++ b/drivers/sensor/vl53l0x/CMakeLists.txt @@ -1,4 +1,6 @@ -zephyr_sources( +zephyr_library() + +zephyr_library_sources( vl53l0x.c vl53l0x_platform.c ) diff --git a/drivers/serial/CMakeLists.txt b/drivers/serial/CMakeLists.txt index 59f1e7bcb9b..0bc9b2a41bc 100644 --- a/drivers/serial/CMakeLists.txt +++ b/drivers/serial/CMakeLists.txt @@ -1,24 +1,26 @@ -zephyr_sources_ifdef(CONFIG_UART_ALTERA_JTAG uart_altera_jtag_hal.c) -zephyr_sources_if_kconfig(uart_imx.c) -zephyr_sources_if_kconfig(uart_cc32xx.c) -zephyr_sources_if_kconfig(uart_cmsdk_apb.c) -zephyr_sources_if_kconfig(uart_esp32.c) -zephyr_sources_if_kconfig(uart_fe310.c) -zephyr_sources_if_kconfig(uart_gecko.c) -zephyr_sources_if_kconfig(uart_mcux.c) -zephyr_sources_if_kconfig(uart_mcux_lpuart.c) -zephyr_sources_if_kconfig(uart_mcux_lpsci.c) -zephyr_sources_if_kconfig(uart_msp432p4xx.c) -zephyr_sources_if_kconfig(uart_nrf5.c) -zephyr_sources_if_kconfig(uart_ns16550.c) -zephyr_sources_if_kconfig(uart_nsim.c) -zephyr_sources_if_kconfig(uart_qmsi.c) -zephyr_sources_if_kconfig(uart_riscv_qemu.c) -zephyr_sources_if_kconfig(uart_sam.c) -zephyr_sources_if_kconfig(usart_sam.c) -zephyr_sources_if_kconfig(uart_stellaris.c) -zephyr_sources_if_kconfig(uart_stm32.c) -zephyr_sources_if_kconfig(uart_sam0.c) -zephyr_sources_if_kconfig(usart_mcux_lpc.c) +zephyr_library_ifdef(CONFIG_SERIAL_HAS_DRIVER) -zephyr_sources_ifdef(CONFIG_USERSPACE uart_handlers.c) +zephyr_library_sources_ifdef(CONFIG_UART_ALTERA_JTAG uart_altera_jtag_hal.c) +zephyr_library_sources_if_kconfig(uart_imx.c) +zephyr_library_sources_if_kconfig(uart_cc32xx.c) +zephyr_library_sources_if_kconfig(uart_cmsdk_apb.c) +zephyr_library_sources_if_kconfig(uart_esp32.c) +zephyr_library_sources_if_kconfig(uart_fe310.c) +zephyr_library_sources_if_kconfig(uart_gecko.c) +zephyr_library_sources_if_kconfig(uart_mcux.c) +zephyr_library_sources_if_kconfig(uart_mcux_lpuart.c) +zephyr_library_sources_if_kconfig(uart_mcux_lpsci.c) +zephyr_library_sources_if_kconfig(uart_msp432p4xx.c) +zephyr_library_sources_if_kconfig(uart_nrf5.c) +zephyr_library_sources_if_kconfig(uart_ns16550.c) +zephyr_library_sources_if_kconfig(uart_nsim.c) +zephyr_library_sources_if_kconfig(uart_qmsi.c) +zephyr_library_sources_if_kconfig(uart_riscv_qemu.c) +zephyr_library_sources_if_kconfig(uart_sam.c) +zephyr_library_sources_if_kconfig(usart_sam.c) +zephyr_library_sources_if_kconfig(uart_stellaris.c) +zephyr_library_sources_if_kconfig(uart_stm32.c) +zephyr_library_sources_if_kconfig(uart_sam0.c) +zephyr_library_sources_if_kconfig(usart_mcux_lpc.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c) diff --git a/drivers/spi/CMakeLists.txt b/drivers/spi/CMakeLists.txt index 34ba9a8e881..e5a3590764d 100644 --- a/drivers/spi/CMakeLists.txt +++ b/drivers/spi/CMakeLists.txt @@ -1,10 +1,12 @@ -zephyr_sources_ifdef(CONFIG_SPI_DW spi_dw.c) -zephyr_sources_ifdef(CONFIG_SPI_INTEL spi_intel.c) -zephyr_sources_ifdef(CONFIG_SPI_STM32 spi_ll_stm32.c) -zephyr_sources_ifdef(CONFIG_SPI_MCUX_DSPI spi_mcux_dspi.c) -zephyr_sources_ifdef(CONFIG_SPI_SAM0 spi_sam0.c) -zephyr_sources_ifdef(CONFIG_NRFX_SPI spi_nrfx_spi.c) -zephyr_sources_ifdef(CONFIG_NRFX_SPIM spi_nrfx_spim.c) -zephyr_sources_ifdef(CONFIG_NRFX_SPIS spi_nrfx_spis.c) +zephyr_library() -zephyr_sources_ifdef(CONFIG_USERSPACE spi_handlers.c) +zephyr_library_sources_ifdef(CONFIG_SPI_DW spi_dw.c) +zephyr_library_sources_ifdef(CONFIG_SPI_INTEL spi_intel.c) +zephyr_library_sources_ifdef(CONFIG_SPI_STM32 spi_ll_stm32.c) +zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_DSPI spi_mcux_dspi.c) +zephyr_library_sources_ifdef(CONFIG_SPI_SAM0 spi_sam0.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_SPI spi_nrfx_spi.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_SPIM spi_nrfx_spim.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_SPIS spi_nrfx_spis.c) + +zephyr_library_sources_ifdef(CONFIG_USERSPACE spi_handlers.c)