cmake: remove _if_kconfig() functions

This set of functions seem to be there just because of historical
reasons, stemming from Kbuild. They are non-obvious and prone to errors,
so remove them in favor of the `_ifdef()` ones with an explicit
`CONFIG_` condition.

Script used:

git grep -l _if_kconfig | xargs sed -E -i
"s/_if_kconfig\(\s*(\w*)/_ifdef(CONFIG_\U\1\E \1/g"

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2020-07-31 13:52:40 +02:00 committed by Carles Cufí
parent dc48999ee1
commit 244f826e3c
29 changed files with 129 additions and 161 deletions

View file

@ -22,7 +22,7 @@ zephyr_library_sources(
zephyr_library_sources_ifdef(CONFIG_CACHE_FLUSHING cache.c)
zephyr_library_sources_ifdef(CONFIG_ARC_FIRQ fast_irq.S)
zephyr_library_sources_if_kconfig(irq_offload.c)
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.S)
zephyr_library_sources_ifdef(CONFIG_ARC_CONNECT arc_connect.c)

View file

@ -2,5 +2,5 @@
zephyr_library()
zephyr_library_sources_if_kconfig(arc_core_mpu.c)
zephyr_library_sources_if_kconfig(arc_mpu.c)
zephyr_library_sources_ifdef(CONFIG_ARC_CORE_MPU arc_core_mpu.c)
zephyr_library_sources_ifdef(CONFIG_ARC_MPU arc_mpu.c)

View file

@ -15,4 +15,4 @@ zephyr_library_sources(
crt0.S
)
zephyr_library_sources_if_kconfig(irq_offload.c)
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)

View file

@ -13,4 +13,4 @@ zephyr_library_sources(
thread.c
)
zephyr_library_sources_if_kconfig(irq_offload.c)
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)

View file

@ -13,12 +13,12 @@ zephyr_library_sources(prep_c.c)
zephyr_library_sources(fatal.c)
zephyr_library_sources(spec_ctrl.c)
zephyr_library_sources_if_kconfig(pcie.c)
zephyr_library_sources_if_kconfig(reboot_rst_cnt.c)
zephyr_library_sources_if_kconfig(multiboot.c)
zephyr_library_sources_if_kconfig(acpi.c)
zephyr_library_sources_if_kconfig(x86_mmu.c)
zephyr_library_sources_if_kconfig(userspace.c)
zephyr_library_sources_ifdef(CONFIG_PCIE pcie.c)
zephyr_library_sources_ifdef(CONFIG_REBOOT_RST_CNT reboot_rst_cnt.c)
zephyr_library_sources_ifdef(CONFIG_MULTIBOOT multiboot.c)
zephyr_library_sources_ifdef(CONFIG_ACPI acpi.c)
zephyr_library_sources_ifdef(CONFIG_X86_MMU x86_mmu.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.c)
zephyr_library_sources_ifdef(CONFIG_X86_VERY_EARLY_CONSOLE early_serial.c)

View file

@ -6,4 +6,4 @@
zephyr_library()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_library_sources_if_kconfig(pinmux.c)
zephyr_library_sources_ifdef(CONFIG_PINMUX pinmux.c)

View file

@ -6,4 +6,4 @@
zephyr_library()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_library_sources_if_kconfig(pinmux.c)
zephyr_library_sources_ifdef(CONFIG_PINMUX pinmux.c)

View file

@ -4,4 +4,4 @@
# SPDX-License-Identifier: Apache-2.0
#
zephyr_sources_if_kconfig( nrf_timer_timer.c)
zephyr_sources_ifdef(CONFIG_NRF_TIMER_TIMER nrf_timer_timer.c)

View file

@ -11,8 +11,7 @@
# 1.4. board_*
# 1.5. Misc.
# 2. Kconfig-aware extensions
# 2.1 *_if_kconfig
# 2.2 Misc
# 2.1 Misc
# 3. CMake-generic extensions
# 3.1. *_ifdef
# 3.2. *_ifndef
@ -1020,42 +1019,8 @@ endfunction()
# Kconfig is a configuration language developed for the Linux
# kernel. The below functions integrate CMake with Kconfig.
#
# 2.1 *_if_kconfig
#
# Functions for conditionally including directories and source files
# that have matching KConfig values.
#
# zephyr_library_sources_if_kconfig(fft.c)
# is the same as
# zephyr_library_sources_ifdef(CONFIG_FFT fft.c)
#
# add_subdirectory_if_kconfig(serial)
# is the same as
# add_subdirectory_ifdef(CONFIG_SERIAL serial)
function(add_subdirectory_if_kconfig dir)
string(TOUPPER config_${dir} UPPER_CASE_CONFIG)
add_subdirectory_ifdef(${UPPER_CASE_CONFIG} ${dir})
endfunction()
function(target_sources_if_kconfig target scope item)
get_filename_component(item_basename ${item} NAME_WE)
string(TOUPPER CONFIG_${item_basename} UPPER_CASE_CONFIG)
target_sources_ifdef(${UPPER_CASE_CONFIG} ${target} ${scope} ${item})
endfunction()
function(zephyr_library_sources_if_kconfig item)
get_filename_component(item_basename ${item} NAME_WE)
string(TOUPPER CONFIG_${item_basename} UPPER_CASE_CONFIG)
zephyr_library_sources_ifdef(${UPPER_CASE_CONFIG} ${item})
endfunction()
function(zephyr_sources_if_kconfig item)
get_filename_component(item_basename ${item} NAME_WE)
string(TOUPPER CONFIG_${item_basename} UPPER_CASE_CONFIG)
zephyr_sources_ifdef(${UPPER_CASE_CONFIG} ${item})
endfunction()
# 2.2 Misc
# 2.1 Misc
#
# import_kconfig(<prefix> <kconfig_fragment> [<keys>])
#

View file

@ -85,6 +85,11 @@ Removed APIs in this release
:ref:`util_api`. Use ``FOR_EACH`` instead.
* The CONFIG_NET_IF_USERSPACE_ACCESS is removed as it is no longer needed.
* Build system
* The set of ``*_if_kconfig()`` CMake functions have been removed. Use
``_ifdef(CONFIG_ ...)`` instead.
Stable API changes in this release
==================================

View file

@ -6,40 +6,38 @@ add_subdirectory(console)
add_subdirectory(interrupt_controller)
add_subdirectory(pcie)
add_subdirectory_if_kconfig(adc)
add_subdirectory_if_kconfig(clock_control)
add_subdirectory_if_kconfig(counter)
add_subdirectory_if_kconfig(crypto)
add_subdirectory_if_kconfig(dac)
add_subdirectory_if_kconfig(display)
add_subdirectory_if_kconfig(dma)
add_subdirectory_if_kconfig(gpio)
add_subdirectory_if_kconfig(grove)
add_subdirectory_if_kconfig(i2c)
add_subdirectory_if_kconfig(i2s)
add_subdirectory_if_kconfig(ieee802154)
add_subdirectory_if_kconfig(ipm)
add_subdirectory_if_kconfig(led)
add_subdirectory_if_kconfig(led_strip)
add_subdirectory_if_kconfig(modem)
add_subdirectory_if_kconfig(pinmux)
add_subdirectory_if_kconfig(pwm)
add_subdirectory_if_kconfig(rtc)
add_subdirectory_if_kconfig(sensor)
add_subdirectory_if_kconfig(spi)
add_subdirectory_if_kconfig(usb)
add_subdirectory_if_kconfig(watchdog)
add_subdirectory_if_kconfig(wifi)
add_subdirectory_if_kconfig(can)
add_subdirectory_if_kconfig(audio)
add_subdirectory_if_kconfig(hwinfo)
add_subdirectory_if_kconfig(espi)
add_subdirectory_if_kconfig(ps2)
add_subdirectory_if_kconfig(kscan)
add_subdirectory_if_kconfig(video)
add_subdirectory_if_kconfig(eeprom)
add_subdirectory_if_kconfig(lora)
add_subdirectory_if_kconfig(peci)
add_subdirectory_ifdef(CONFIG_ADC adc)
add_subdirectory_ifdef(CONFIG_CLOCK_CONTROL clock_control)
add_subdirectory_ifdef(CONFIG_COUNTER counter)
add_subdirectory_ifdef(CONFIG_CRYPTO crypto)
add_subdirectory_ifdef(CONFIG_DAC dac)
add_subdirectory_ifdef(CONFIG_DISPLAY display)
add_subdirectory_ifdef(CONFIG_DMA dma)
add_subdirectory_ifdef(CONFIG_GPIO gpio)
add_subdirectory_ifdef(CONFIG_I2C i2c)
add_subdirectory_ifdef(CONFIG_I2S i2s)
add_subdirectory_ifdef(CONFIG_IEEE802154 ieee802154)
add_subdirectory_ifdef(CONFIG_IPM ipm)
add_subdirectory_ifdef(CONFIG_LED led)
add_subdirectory_ifdef(CONFIG_LED_STRIP led_strip)
add_subdirectory_ifdef(CONFIG_MODEM modem)
add_subdirectory_ifdef(CONFIG_PINMUX pinmux)
add_subdirectory_ifdef(CONFIG_PWM pwm)
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
add_subdirectory_ifdef(CONFIG_SPI spi)
add_subdirectory_ifdef(CONFIG_USB usb)
add_subdirectory_ifdef(CONFIG_WATCHDOG watchdog)
add_subdirectory_ifdef(CONFIG_WIFI wifi)
add_subdirectory_ifdef(CONFIG_CAN can)
add_subdirectory_ifdef(CONFIG_AUDIO audio)
add_subdirectory_ifdef(CONFIG_HWINFO hwinfo)
add_subdirectory_ifdef(CONFIG_ESPI espi)
add_subdirectory_ifdef(CONFIG_PS2 ps2)
add_subdirectory_ifdef(CONFIG_KSCAN kscan)
add_subdirectory_ifdef(CONFIG_VIDEO video)
add_subdirectory_ifdef(CONFIG_EEPROM eeprom)
add_subdirectory_ifdef(CONFIG_LORA lora)
add_subdirectory_ifdef(CONFIG_PECI peci)
add_subdirectory_ifdef(CONFIG_FLASH_HAS_DRIVER_ENABLED flash)
add_subdirectory_ifdef(CONFIG_SERIAL_HAS_DRIVER serial)

View file

@ -1,14 +1,14 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_if_kconfig(uart_console.c)
zephyr_sources_if_kconfig(ram_console.c)
zephyr_sources_if_kconfig(rtt_console.c)
zephyr_sources_if_kconfig(ipm_console_receiver.c)
zephyr_sources_if_kconfig(ipm_console_sender.c)
zephyr_sources_if_kconfig(uart_mcumgr.c)
zephyr_sources_if_kconfig(uart_pipe.c)
zephyr_sources_if_kconfig(xtensa_sim_console.c)
zephyr_sources_if_kconfig(native_posix_console.c)
zephyr_sources_if_kconfig(uart_mux.c)
zephyr_sources_if_kconfig(gsm_mux.c)
zephyr_sources_if_kconfig(semihost_console.c)
zephyr_sources_ifdef(CONFIG_UART_CONSOLE uart_console.c)
zephyr_sources_ifdef(CONFIG_RAM_CONSOLE ram_console.c)
zephyr_sources_ifdef(CONFIG_RTT_CONSOLE rtt_console.c)
zephyr_sources_ifdef(CONFIG_IPM_CONSOLE_RECEIVER ipm_console_receiver.c)
zephyr_sources_ifdef(CONFIG_IPM_CONSOLE_SENDER ipm_console_sender.c)
zephyr_sources_ifdef(CONFIG_UART_MCUMGR uart_mcumgr.c)
zephyr_sources_ifdef(CONFIG_UART_PIPE uart_pipe.c)
zephyr_sources_ifdef(CONFIG_XTENSA_SIM_CONSOLE xtensa_sim_console.c)
zephyr_sources_ifdef(CONFIG_NATIVE_POSIX_CONSOLE native_posix_console.c)
zephyr_sources_ifdef(CONFIG_UART_MUX uart_mux.c)
zephyr_sources_ifdef(CONFIG_GSM_MUX gsm_mux.c)
zephyr_sources_ifdef(CONFIG_SEMIHOST_CONSOLE semihost_console.c)

View file

@ -8,6 +8,6 @@ zephyr_library_sources_ifdef(CONFIG_IPM_MHU ipm_mhu.c)
zephyr_library_sources_ifdef(CONFIG_IPM_STM32_IPCC ipm_stm32_ipcc.c)
zephyr_library_sources_ifdef(CONFIG_IPM_NRFX ipm_nrfx_ipc.c)
zephyr_library_sources_if_kconfig(ipm_cavs_idc.c)
zephyr_library_sources_ifdef(CONFIG_IPM_CAVS_IDC ipm_cavs_idc.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE ipm_handlers.c)

View file

@ -2,36 +2,36 @@
zephyr_library()
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_cc13xx_cc26xx.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_sifive.c)
zephyr_library_sources_if_kconfig(uart_gecko.c)
zephyr_library_sources_if_kconfig(leuart_gecko.c)
zephyr_library_sources_if_kconfig(uart_lpc11u6x.c)
zephyr_library_sources_if_kconfig(uart_mcux.c)
zephyr_library_sources_if_kconfig(uart_mcux_flexcomm.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_miv.c)
zephyr_library_sources_if_kconfig(uart_msp432p4xx.c)
zephyr_library_sources_ifdef(CONFIG_UART_IMX uart_imx.c)
zephyr_library_sources_ifdef(CONFIG_UART_CC13XX_CC26XX uart_cc13xx_cc26xx.c)
zephyr_library_sources_ifdef(CONFIG_UART_CC32XX uart_cc32xx.c)
zephyr_library_sources_ifdef(CONFIG_UART_CMSDK_APB uart_cmsdk_apb.c)
zephyr_library_sources_ifdef(CONFIG_UART_ESP32 uart_esp32.c)
zephyr_library_sources_ifdef(CONFIG_UART_SIFIVE uart_sifive.c)
zephyr_library_sources_ifdef(CONFIG_UART_GECKO uart_gecko.c)
zephyr_library_sources_ifdef(CONFIG_LEUART_GECKO leuart_gecko.c)
zephyr_library_sources_ifdef(CONFIG_UART_LPC11U6X uart_lpc11u6x.c)
zephyr_library_sources_ifdef(CONFIG_UART_MCUX uart_mcux.c)
zephyr_library_sources_ifdef(CONFIG_UART_MCUX_FLEXCOMM uart_mcux_flexcomm.c)
zephyr_library_sources_ifdef(CONFIG_UART_MCUX_LPUART uart_mcux_lpuart.c)
zephyr_library_sources_ifdef(CONFIG_UART_MCUX_LPSCI uart_mcux_lpsci.c)
zephyr_library_sources_ifdef(CONFIG_UART_MIV uart_miv.c)
zephyr_library_sources_ifdef(CONFIG_UART_MSP432P4XX uart_msp432p4xx.c)
zephyr_library_sources_ifdef(CONFIG_NRF_UART_PERIPHERAL uart_nrfx_uart.c)
zephyr_library_sources_ifdef(CONFIG_NRF_UARTE_PERIPHERAL uart_nrfx_uarte.c)
zephyr_library_sources_if_kconfig(uart_nuvoton.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(uart_psoc6.c)
zephyr_library_sources_if_kconfig(uart_pl011.c)
zephyr_library_sources_if_kconfig(uart_rv32m1_lpuart.c)
zephyr_library_sources_if_kconfig(uart_liteuart.c)
zephyr_library_sources_ifdef(CONFIG_UART_NUVOTON uart_nuvoton.c)
zephyr_library_sources_ifdef(CONFIG_UART_SAM uart_sam.c)
zephyr_library_sources_ifdef(CONFIG_USART_SAM usart_sam.c)
zephyr_library_sources_ifdef(CONFIG_UART_STELLARIS uart_stellaris.c)
zephyr_library_sources_ifdef(CONFIG_UART_STM32 uart_stm32.c)
zephyr_library_sources_ifdef(CONFIG_UART_SAM0 uart_sam0.c)
zephyr_library_sources_ifdef(CONFIG_UART_PSOC6 uart_psoc6.c)
zephyr_library_sources_ifdef(CONFIG_UART_PL011 uart_pl011.c)
zephyr_library_sources_ifdef(CONFIG_UART_RV32M1_LPUART uart_rv32m1_lpuart.c)
zephyr_library_sources_ifdef(CONFIG_UART_LITEUART uart_liteuart.c)
zephyr_library_sources_ifdef(CONFIG_UART_RTT_DRIVER uart_rtt.c)
zephyr_library_sources_if_kconfig(uart_xlnx_ps.c)
zephyr_library_sources_if_kconfig(uart_xmc4xxx.c)
zephyr_library_sources_ifdef(CONFIG_UART_XLNX_PS uart_xlnx_ps.c)
zephyr_library_sources_ifdef(CONFIG_UART_XMC4XXX uart_xmc4xxx.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)

View file

@ -4,19 +4,19 @@ zephyr_sources( sys_clock_init.c)
zephyr_sources_ifdef(CONFIG_HPET_TIMER hpet.c)
zephyr_sources_ifdef(CONFIG_ARCV2_TIMER arcv2_timer0.c)
zephyr_sources_ifdef(CONFIG_ARM_ARCH_TIMER arm_arch_timer.c)
zephyr_sources_if_kconfig( loapic_timer.c)
zephyr_sources_if_kconfig( apic_timer.c)
zephyr_sources_ifdef(CONFIG_LOAPIC_TIMER loapic_timer.c)
zephyr_sources_ifdef(CONFIG_APIC_TIMER apic_timer.c)
zephyr_sources_ifdef(CONFIG_ALTERA_AVALON_TIMER altera_avalon_timer_hal.c)
zephyr_sources_if_kconfig( nrf_rtc_timer.c)
zephyr_sources_if_kconfig( stm32_lptim_timer.c)
zephyr_sources_if_kconfig( riscv_machine_timer.c)
zephyr_sources_if_kconfig( rv32m1_lptmr_timer.c)
zephyr_sources_if_kconfig( cortex_m_systick.c)
zephyr_sources_ifdef(CONFIG_NRF_RTC_TIMER nrf_rtc_timer.c)
zephyr_sources_ifdef(CONFIG_STM32_LPTIM_TIMER stm32_lptim_timer.c)
zephyr_sources_ifdef(CONFIG_RISCV_MACHINE_TIMER riscv_machine_timer.c)
zephyr_sources_ifdef(CONFIG_RV32M1_LPTMR_TIMER rv32m1_lptmr_timer.c)
zephyr_sources_ifdef(CONFIG_CORTEX_M_SYSTICK cortex_m_systick.c)
zephyr_sources_ifdef(CONFIG_XTENSA_TIMER xtensa_sys_timer.c)
zephyr_sources_if_kconfig( native_posix_timer.c)
zephyr_sources_if_kconfig( sam0_rtc_timer.c)
zephyr_sources_if_kconfig( litex_timer.c)
zephyr_sources_if_kconfig( mchp_xec_rtos_timer.c)
zephyr_sources_if_kconfig( xlnx_psttc_timer.c)
zephyr_sources_if_kconfig( cc13x2_cc26x2_rtc_timer.c)
zephyr_sources_if_kconfig( cavs_timer.c)
zephyr_sources_ifdef(CONFIG_NATIVE_POSIX_TIMER native_posix_timer.c)
zephyr_sources_ifdef(CONFIG_SAM0_RTC_TIMER sam0_rtc_timer.c)
zephyr_sources_ifdef(CONFIG_LITEX_TIMER litex_timer.c)
zephyr_sources_ifdef(CONFIG_MCHP_XEC_RTOS_TIMER mchp_xec_rtos_timer.c)
zephyr_sources_ifdef(CONFIG_XLNX_PSTTC_TIMER xlnx_psttc_timer.c)
zephyr_sources_ifdef(CONFIG_CC13X2_CC26X2_RTC_TIMER cc13x2_cc26x2_rtc_timer.c)
zephyr_sources_ifdef(CONFIG_CAVS_TIMER cavs_timer.c)

View file

@ -39,8 +39,8 @@ set_target_properties(
target_sources_ifdef(CONFIG_STACK_CANARIES kernel PRIVATE compiler_stack_protect.c)
target_sources_ifdef(CONFIG_SYS_CLOCK_EXISTS kernel PRIVATE timeout.c timer.c)
target_sources_ifdef(CONFIG_ATOMIC_OPERATIONS_C kernel PRIVATE atomic_c.c)
target_sources_if_kconfig( kernel PRIVATE mmu.c)
target_sources_if_kconfig( kernel PRIVATE poll.c)
target_sources_ifdef(CONFIG_MMU kernel PRIVATE mmu.c)
target_sources_ifdef(CONFIG_POLL kernel PRIVATE poll.c)
if(${CONFIG_MEM_POOL_HEAP_BACKEND})
else()

View file

@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
add_subdirectory_if_kconfig(lvgl)
add_subdirectory_ifdef(CONFIG_LVGL lvgl)

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_if_kconfig(base64.c)
zephyr_sources_ifdef(CONFIG_BASE64 base64.c)
zephyr_sources(
crc32_sw.c
@ -25,7 +25,7 @@ zephyr_sources(
zephyr_sources_ifdef(CONFIG_JSON_LIBRARY json.c)
zephyr_sources_if_kconfig(ring_buffer.c)
zephyr_sources_ifdef(CONFIG_RING_BUFFER ring_buffer.c)
zephyr_sources_ifdef(CONFIG_ASSERT assert.c)

View file

@ -20,5 +20,5 @@ add_subdirectory(power)
add_subdirectory(stats)
add_subdirectory(testsuite)
add_subdirectory(tracing)
add_subdirectory_if_kconfig(jwt)
add_subdirectory_ifdef(CONFIG_JWT jwt)
add_subdirectory(canbus)

View file

@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
add_subdirectory_if_kconfig(canopen)
add_subdirectory_if_kconfig(isotp)
add_subdirectory_ifdef(CONFIG_CANOPEN canopen)
add_subdirectory_ifdef(CONFIG_ISOTP isotp)

View file

@ -4,6 +4,6 @@ zephyr_library()
zephyr_library_sources_ifdef(CONFIG_CANOPEN CO_driver.c)
zephyr_library_sources_ifdef(CONFIG_CANOPEN_SYNC_THREAD canopen_sync.c)
zephyr_library_sources_ifdef(CONFIG_CANOPEN_STORAGE canopen_storage.c)
zephyr_library_sources_if_kconfig(canopen_leds.c)
zephyr_library_sources_ifdef(CONFIG_CANOPEN_LEDS canopen_leds.c)
zephyr_library_sources_ifdef(CONFIG_CANOPEN_PROGRAM_DOWNLOAD canopen_program.c)
zephyr_include_directories(.)

View file

@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources_if_kconfig(isotp.c)
zephyr_library_sources_ifdef(CONFIG_ISOTP isotp.c)

View file

@ -4,5 +4,5 @@ zephyr_sources_ifdef(CONFIG_DISK_ACCESS disk_access.c)
zephyr_sources_ifdef(CONFIG_DISK_ACCESS_FLASH disk_access_flash.c)
zephyr_sources_ifdef(CONFIG_DISK_ACCESS_RAM disk_access_ram.c)
zephyr_sources_ifdef(CONFIG_DISK_ACCESS_SPI_SDHC disk_access_spi_sdhc.c)
zephyr_sources_if_kconfig(disk_access_stm32_sdmmc.c)
zephyr_sources_ifdef(CONFIG_DISK_ACCESS_STM32_SDMMC disk_access_stm32_sdmmc.c)
zephyr_sources_ifdef(CONFIG_DISK_ACCESS_USDHC disk_access_usdhc.c)

View file

@ -1,10 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(utils)
add_subdirectory_if_kconfig(coap)
add_subdirectory_if_kconfig(lwm2m)
add_subdirectory_if_kconfig(socks)
add_subdirectory_if_kconfig(sntp)
add_subdirectory_ifdef(CONFIG_COAP coap)
add_subdirectory_ifdef(CONFIG_LWM2M lwm2m)
add_subdirectory_ifdef(CONFIG_SOCKS socks)
add_subdirectory_ifdef(CONFIG_SNTP sntp)
add_subdirectory_ifdef(CONFIG_MQTT_LIB mqtt)
add_subdirectory_ifdef(CONFIG_TFTP_LIB tftp)
add_subdirectory_ifdef(CONFIG_NET_CONFIG_SETTINGS config)

View file

@ -8,6 +8,6 @@ endif()
zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/ip)
zephyr_library_sources_if_kconfig(http_parser.c)
zephyr_library_sources_if_kconfig(http_parser_url.c)
zephyr_library_sources_if_kconfig(http_client.c)
zephyr_library_sources_ifdef(CONFIG_HTTP_PARSER http_parser.c)
zephyr_library_sources_ifdef(CONFIG_HTTP_PARSER_URL http_parser_url.c)
zephyr_library_sources_ifdef(CONFIG_HTTP_CLIENT http_client.c)

View file

@ -2,4 +2,4 @@
zephyr_library()
zephyr_library_sources_if_kconfig(socks.c)
zephyr_library_sources_ifdef(CONFIG_SOCKS socks.c)

View file

@ -4,5 +4,5 @@ zephyr_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT power.c)
zephyr_sources_ifdef(CONFIG_DEVICE_POWER_MANAGEMENT device.c)
zephyr_sources_ifdef(CONFIG_SYS_PM_STATE_LOCK pm_ctrl.c)
zephyr_sources_ifdef(CONFIG_DEVICE_IDLE_PM device_pm.c)
zephyr_sources_if_kconfig(reboot.c)
zephyr_sources_ifdef(CONFIG_REBOOT reboot.c)
add_subdirectory(policy)

View file

@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_if_kconfig(stats.c)
zephyr_sources_ifdef(CONFIG_STATS stats.c)

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
add_subdirectory_if_kconfig(ztest)
add_subdirectory_ifdef(CONFIG_ZTEST ztest)
zephyr_include_directories_ifdef(CONFIG_TEST
${ZEPHYR_BASE}/subsys/testsuite/include