From 361956b6696cd70e667324050dd8e08750d1b127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Mon, 9 Aug 2021 10:46:17 -0700 Subject: [PATCH] cmake: add a comment header to zephyr_settings.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I saw a user wondering what this is for and and where it comes from. Provide a comment header with some explanation and a pointer to where to find out more. Signed-off-by: Martí Bolívar --- cmake/zephyr_module.cmake | 2 +- scripts/zephyr_module.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/zephyr_module.cmake b/cmake/zephyr_module.cmake index c5fbc06ac88..d0e8b85f7fc 100644 --- a/cmake/zephyr_module.cmake +++ b/cmake/zephyr_module.cmake @@ -62,7 +62,7 @@ if(WEST OR ZEPHYR_MODULES) endif() if(EXISTS ${ZEPHYR_SETTINGS_FILE}) - file(STRINGS ${ZEPHYR_SETTINGS_FILE} ZEPHYR_SETTINGS_TXT ENCODING UTF-8) + file(STRINGS ${ZEPHYR_SETTINGS_FILE} ZEPHYR_SETTINGS_TXT ENCODING UTF-8 REGEX "^[^#]") foreach(setting ${ZEPHYR_SETTINGS_TXT}) # Match : for each line of file, each corresponding to # a setting. The use of quotes is required due to CMake not supporting diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index 19fae00ed12..9d100ed495e 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -375,6 +375,16 @@ def main(): if args.settings_out: with open(args.settings_out, 'w', encoding="utf-8") as fp: + fp.write('''\ +# WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! +# +# This file contains build system settings derived from your modules. +# +# Modules may be set via ZEPHYR_MODULES, ZEPHYR_EXTRA_MODULES, +# and/or the west manifest file. +# +# See the Modules guide for more information. +''') fp.write(settings) if args.twister_out: