cmake: add app boards subdir as search location for board overlay files
Putting overlay files in the test/sample root clutters the file system. Allow them to be in the boards subdirectory alongside board.conf files. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
89a984e644
commit
0582a0c1bf
2 changed files with 13 additions and 13 deletions
|
@ -422,6 +422,8 @@ if(DTC_OVERLAY_FILE)
|
||||||
# variable DTC_OVERLAY_FILE
|
# variable DTC_OVERLAY_FILE
|
||||||
elseif(DEFINED ENV{DTC_OVERLAY_FILE})
|
elseif(DEFINED ENV{DTC_OVERLAY_FILE})
|
||||||
set(DTC_OVERLAY_FILE $ENV{DTC_OVERLAY_FILE})
|
set(DTC_OVERLAY_FILE $ENV{DTC_OVERLAY_FILE})
|
||||||
|
elseif(EXISTS ${APPLICATION_SOURCE_DIR}/boards/${BOARD}.overlay)
|
||||||
|
set(DTC_OVERLAY_FILE ${APPLICATION_SOURCE_DIR}/boards/${BOARD}.overlay)
|
||||||
elseif(EXISTS ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay)
|
elseif(EXISTS ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay)
|
||||||
set(DTC_OVERLAY_FILE ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay)
|
set(DTC_OVERLAY_FILE ${APPLICATION_SOURCE_DIR}/${BOARD}.overlay)
|
||||||
elseif(EXISTS ${APPLICATION_SOURCE_DIR}/app.overlay)
|
elseif(EXISTS ${APPLICATION_SOURCE_DIR}/app.overlay)
|
||||||
|
|
|
@ -1532,20 +1532,18 @@ the C preprocessor on a file which includes the following:
|
||||||
#. Any file or files given by the :makevar:`DTC_OVERLAY_FILE` CMake
|
#. Any file or files given by the :makevar:`DTC_OVERLAY_FILE` CMake
|
||||||
variable.
|
variable.
|
||||||
|
|
||||||
The Zephyr build system determines :makevar:`DTC_OVERLAY_FILE` as
|
The Zephyr build system determines the ``DTC_OVERLAY_FILE`` value by
|
||||||
follows:
|
looking at these potential definition locations, in order, until a value
|
||||||
|
is determined, and then stops looking:
|
||||||
|
|
||||||
- Any value given to :makevar:`DTC_OVERLAY_FILE` in your application
|
1. the cmake command line (``-DDTC_OVERLAY_FILE=filename``)
|
||||||
:file:`CMakeLists.txt` (**before including the boilerplate.cmake file**),
|
#. the cmake variable cache (from a previous cmake run)
|
||||||
passed to the the CMake command line, or present in the CMake variable cache,
|
#. a ``CMakeLists.txt`` file in your application folder
|
||||||
takes precedence.
|
#. a ``DTC_OVERLAY_FILE`` environment variable (deprecated)
|
||||||
|
#. a ``boards/<BOARD>.overlay`` file in your application folder,
|
||||||
- The :ref:`environment variable <env_vars>` :envvar:`DTC_OVERLAY_FILE` is
|
for your specified ``<BOARD>``
|
||||||
checked next. This mechanism is now deprecated; users should set this
|
#. a ``<BOARD>.overlay`` file in your application folder, for
|
||||||
variable using CMake instead of the environment.
|
your specified ``<BOARD>``
|
||||||
|
|
||||||
- If the file :file:`BOARD.overlay` exists in your application directory,
|
|
||||||
where ``BOARD`` is the BOARD value set earlier, it will be used.
|
|
||||||
|
|
||||||
If :makevar:`DTC_OVERLAY_FILE` specifies multiple files, they are
|
If :makevar:`DTC_OVERLAY_FILE` specifies multiple files, they are
|
||||||
included in order by the C preprocessor.
|
included in order by the C preprocessor.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue