diff options
author | Yuval Peress <peress@google.com> | 2022-10-03 13:12:45 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-06 17:00:39 +0000 |
commit | cefc4c4e4a34420465fb948bd61893396c0ea3c3 (patch) | |
tree | 1bd6572cb5b56e136e8d94fc9b11016b95c9b871 | |
parent | aed94bc73cc576b8fa5574bb8eaad02ce85ee35c (diff) | |
download | chrome-ec-stabilize-15167.B-main.tar.gz |
zephyr: Move root cmakestabilize-15167.B-main
Move the root level CMake for the EC module to the top level directory.
This will simplify future changes where zephyr logic is intermixed with
legacy EC logic during the migration effort.
BRANCH=none
BUG=b:246839061
TEST=zmake build -all && ./twister -v
Change-Id: I5e67310b2237aeffdf8033c5cf1201cb67559158
Signed-off-by: Yuval Peress <peress@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3932868
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Aaron Massey <aaronmassey@google.com>
-rw-r--r-- | CMakeLists.txt | 25 | ||||
-rw-r--r-- | Kconfig | 5 | ||||
-rw-r--r-- | zephyr/CMakeLists.txt | 23 | ||||
-rw-r--r-- | zephyr/module.yml | 4 |
4 files changed, 32 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..4becf0edd8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright 2022 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Note: this cmake system implements only a zephyr module, and is not +# intended to build a complete EC. To build projects in platform/ec, +# you should continue to use the Makefile system. +# +# Googlers can find the design doc at go/zephyr-shim. + +if(NOT DEFINED ZEPHYR_CURRENT_MODULE_DIR) + message(FATAL_ERROR "This Cmake system implements only a Zephyr module, and + should not be invoked directly. Please continue to use the Makefile + system for non-Zephyr builds.") +endif() + +set(PLATFORM_EC "${ZEPHYR_CURRENT_MODULE_DIR}" CACHE PATH + "Path to the platform/ec repo.") + +if(NOT EXISTS "${PLATFORM_EC}/zephyr/module.yml") + message(FATAL_ERROR "Failed to resolve PLATFORM_EC at + ${PLATFORM_EC}/zephyr/module.yml") +endif() + +add_subdirectory(zephyr) diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000000..ed64b83cb4 --- /dev/null +++ b/Kconfig @@ -0,0 +1,5 @@ +# Copyright 2022 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +rsource "zephyr/Kconfig" diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 7a71823bc8..920151341c 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -2,29 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Note: this cmake system implements only a zephyr module, and is not -# intended to build a complete EC. To build projects in platform/ec, -# you should continue to use the Makefile system. -# -# Googlers can find the design doc at go/zephyr-shim. - -if(NOT DEFINED ZEPHYR_CURRENT_MODULE_DIR) - message(FATAL_ERROR "This Cmake system implements only a Zephyr module, and - should not be invoked directly. Please continue to use the Makefile - system for non-Zephyr builds.") -endif() - -set(PLATFORM_EC "${ZEPHYR_CURRENT_MODULE_DIR}" CACHE PATH - "Path to the platform/ec repo.") -# Zephyr 2.3 will set ZEPHYR_CURRENT_MODULE_DIR to the directory of the -# CMakeLists.txt file, whereas 2.4 will set it to the actual module -# directory. Try to detect the condition by searching for -# zephyr/module.yml. -if(NOT EXISTS "${PLATFORM_EC}/zephyr/module.yml") - set(PLATFORM_EC "${PLATFORM_EC}/..") - assert_exists("${PLATFORM_EC}/zephyr/module.yml") -endif() - if(DEFINED ZMAKE_INCLUDE_DIR) zephyr_include_directories("${ZMAKE_INCLUDE_DIR}") endif() diff --git a/zephyr/module.yml b/zephyr/module.yml index 7988a425e5..286c090bbd 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -3,7 +3,7 @@ # found in the LICENSE file. build: - cmake: zephyr/ - kconfig: zephyr/Kconfig + cmake: . + kconfig: Kconfig settings: board_root: zephyr/ |