diff options
Diffstat (limited to 'zephyr/zmake')
-rw-r--r-- | zephyr/zmake/tests/test_version.py | 4 | ||||
-rw-r--r-- | zephyr/zmake/zmake/version.py | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/zephyr/zmake/tests/test_version.py b/zephyr/zmake/tests/test_version.py index 44997f94da..a238a8ac02 100644 --- a/zephyr/zmake/tests/test_version.py +++ b/zephyr/zmake/tests/test_version.py @@ -124,6 +124,8 @@ EXPECTED_HEADER = ( '#define CROS_EC_VERSION32 "trogdor_v2.6.1004-cmsis:0dead0,"\n' '#define BUILDER "toukmond@pokey"\n' '#define DATE "2021-06-28 03:18:53"\n' + '#define CROS_FWID_MISSING_STR "CROS_FWID_MISSING"\n' + "#define CROS_FWID32 CROS_FWID_MISSING_STR\n" ) HEADER_VERSION_STR_STATIC = "trogdor_v2.6.0-STATIC" EXPECTED_HEADER_STATIC = ( @@ -132,6 +134,8 @@ EXPECTED_HEADER_STATIC = ( '#define CROS_EC_VERSION32 "trogdor_v2.6.0-STATIC"\n' '#define BUILDER "reproducible@build"\n' '#define DATE "STATIC_VERSION_DATE"\n' + '#define CROS_FWID_MISSING_STR "CROS_FWID_MISSING"\n' + "#define CROS_FWID32 CROS_FWID_MISSING_STR\n" ) diff --git a/zephyr/zmake/zmake/version.py b/zephyr/zmake/zmake/version.py index 2d505769f2..47aba6d804 100644 --- a/zephyr/zmake/zmake/version.py +++ b/zephyr/zmake/zmake/version.py @@ -144,6 +144,9 @@ def write_version_header(version_str, output_path, static=False): def add_def(name, value): output.write("#define {} {}\n".format(name, util.c_str(value))) + def add_def_unquoted(name, value): + output.write("#define {} {}\n".format(name, value)) + add_def("VERSION", version_str) add_def("CROS_EC_VERSION32", version_str[:31]) @@ -154,6 +157,10 @@ def write_version_header(version_str, output_path, static=False): add_def("BUILDER", "{}@{}".format(getpass.getuser(), platform.node())) add_def("DATE", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + add_def("CROS_FWID_MISSING_STR", "CROS_FWID_MISSING") + # TODO(b/198475757): Add zmake support for getting CROS_FWID32 + add_def_unquoted("CROS_FWID32", "CROS_FWID_MISSING_STR") + contents = output.getvalue() if not output_path.exists() or output_path.read_text() != contents: output_path.write_text(contents) |