diff options
-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/ |