Skip to content

Commit

Permalink
drivers/spi: "Remove build error when SPI is not used
Browse files Browse the repository at this point in the history
When building a zephyr sample that does not use the SPI driver, the
following error occurs.

  CMake Error at xxx (target_include_directories):
  Cannot specify include directories for target "drivers__spi" which is not
  built by this project.

This commit removes this error.

Signed-off-by: Takuya Sasaki <takuya.sasaki@spacecubics.com>
  • Loading branch information
sasataku committed Oct 20, 2024
1 parent eb51f8b commit f5a0637
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library_amend()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers/spi)
zephyr_library_sources_ifdef(CONFIG_SPI_SC_QSPI spi_sc.c)
if(CONFIG_SPI)
zephyr_library_amend()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers/spi)
zephyr_library_sources_ifdef(CONFIG_SPI_SC_QSPI spi_sc.c)
endif()

0 comments on commit f5a0637

Please sign in to comment.