Skip to content

Commit dc802a1

Browse files
Revert "[nrf fromlist] cmake: introduction of ZephyrBuildConfiguration package"
This reverts commit 2203105. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 444192d commit dc802a1

File tree

3 files changed

+0
-81
lines changed

3 files changed

+0
-81
lines changed

cmake/app/boilerplate.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ if((NOT DEFINED ZEPHYR_BASE) AND (DEFINED ENV_ZEPHYR_BASE))
8989
set(ZEPHYR_BASE ${ENV_ZEPHYR_BASE} CACHE PATH "Zephyr base")
9090
endif()
9191

92-
find_package(ZephyrBuildConfiguration NAMES ZephyrBuild PATHS ${ZEPHYR_BASE}/../* QUIET NO_DEFAULT_PATH NO_POLICY_SCOPE)
93-
9492
# Note any later project() resets PROJECT_SOURCE_DIR
9593
file(TO_CMAKE_PATH "${ZEPHYR_BASE}" PROJECT_SOURCE_DIR)
9694

doc/guides/env_vars.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ To get this value back into your current terminal environment, **you must run**
106106
The value will be lost if you close the window, etc.; run ``zephyr-env.cmd``
107107
again to get it back.
108108

109-
Option 4: Using Zephyr Build Configuration CMake package
110-
--------------------------------------------------------
111-
112-
Choose this option if you want to make those variable settings shared among all
113-
users of your project.
114-
115-
Using a :ref:`cmake_build_config_package` allows you to commit the shared
116-
settings into the repository, so that all users can share them.
117-
118-
It also removes the need for running ``source zephyr-env.sh`` or
119-
``zephyr-env.cmd`` when opening a new terminal.
120-
121109
.. _zephyr-env:
122110

123111
Zephyr Environment Scripts

doc/guides/zephyr_cmake_package.rst

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -382,72 +382,6 @@ Such a CMakeLists.txt could look as:
382382
383383
project(my_first_app)
384384
385-
.. _cmake_build_config_package:
386-
387-
Zephyr Build Configuration CMake package
388-
****************************************
389-
390-
The Zephyr Build Configuration CMake package provides a possibility for a Zephyr based project to
391-
control Zephyr build settings in a generic way.
392-
393-
It is similar to the use of ``.zephyrrc`` but with the possibility to automatically allow all users
394-
to share the build configuration through the project repository.
395-
But it also allows more advanced use cases than a ``.zephyrrc``-file, such as loading of additional
396-
CMake boilerplate code.
397-
398-
The Zephyr Build Configuration CMake package will be loaded in the Zephyr boilerplate code after
399-
initial properties and ``ZEPHYR_BASE`` has been defined, but before CMake code execution.
400-
This allows the Zephyr Build Configuration CMake package to setup or extend properties such as:
401-
``DTS_ROOT``, ``BOARD_ROOT``, ``TOOLCHAIN_ROOT`` / other toolchain setup, fixed overlays, and any
402-
other property that can be controlled. It also allows inclusion of additional boilerplate code.
403-
404-
To provide a Zephyr Build Configuration CMake package, create ``ZephyrBuildConfig.cmake`` and place
405-
it in a Zephyr workspace top-level folder as:
406-
407-
.. code-block:: none
408-
409-
<projects>/zephyr-workspace
410-
├── zephyr
411-
├── ...
412-
└── zephyr application (can be named anything)
413-
└── share/zephyrbuild-package/cmake/ZephyrBuildConfig.cmake
414-
415-
The Zephyr Build Configuration CMake package will not search in any CMake default search paths, and
416-
thus cannot be installed in the CMake package registry. There will be no version checking on the
417-
Zephyr Build Configuration package.
418-
419-
.. note:: ``share/zephyrbuild-package/cmake/ZephyrBuildConfig.cmake`` follows the same folder
420-
structure as the Zephyr CMake package.
421-
422-
It is possible to place ``ZephyrBuildConfig.cmake`` directly in a
423-
``<zephyr application>/cmake`` folder or another folder, as long as that folder is
424-
honoring the `CMake package search`_ algorithm.
425-
426-
A sample ``ZephyrBuildConfig.cmake`` can be seen below.
427-
428-
.. code-block:: cmake
429-
430-
# ZephyrBuildConfig.cmake sample code
431-
432-
# To ensure final path is absolute and does not contain ../.. in variable.
433-
get_filename_component(APPLICATION_PROJECT_DIR
434-
${CMAKE_CURRENT_LIST_DIR}/../../..
435-
ABSOLUTE
436-
)
437-
438-
# Add this project to list of board roots
439-
list(APPEND BOARD_ROOT ${APPLICATION_PROJECT_DIR})
440-
441-
# Default to GNU Arm Embedded toolchain if no toolchain is set
442-
if(NOT ENV{ZEPHYR_TOOLCHAIN_VARIANT})
443-
set(ZEPHYR_TOOLCHAIN_VARIANT gnuarmemb)
444-
find_program(GNU_ARM_GCC arm-none-eabi-gcc)
445-
if(NOT ${GNU_ARM_GCC} STREQUAL GNU_ARM_GCC-NOTFOUND)
446-
# The toolchain root is located above the path to the compiler.
447-
get_filename_component(GNUARMEMB_TOOLCHAIN_PATH ${GNU_ARM_GCC}/../.. ABSOLUTE)
448-
endif()
449-
endif()
450-
451385
Zephyr CMake package source code
452386
********************************
453387

@@ -494,4 +428,3 @@ The following is an overview of those files
494428
.. _CMake package: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html
495429
.. _CMake user package registry: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#user-package-registry
496430
.. _CMake package version: https://cmake.org/cmake/help/latest/command/find_package.html#version-selection
497-
.. _CMake package search: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure

0 commit comments

Comments
 (0)