From ae2b79462c6b6284256b1a523fc2604528f7cffa Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 12 Sep 2024 11:47:20 -0700 Subject: [PATCH] gfxstream: codegen: don't require clang-format When auto-generating at build time, this causes problems for AOSP: https://android.googlesource.com/platform/build/+/main/Changes.md#PATH_Tools Don't require via environment variable. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- src/gfxstream/codegen/scripts/cereal/common/codegen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gfxstream/codegen/scripts/cereal/common/codegen.py b/src/gfxstream/codegen/scripts/cereal/common/codegen.py index ce7136e9035..688a947e043 100644 --- a/src/gfxstream/codegen/scripts/cereal/common/codegen.py +++ b/src/gfxstream/codegen/scripts/cereal/common/codegen.py @@ -187,9 +187,11 @@ class Module(object): file.write(modified_content) clang_format_command = shutil.which('clang-format') - assert (clang_format_command is not None) def formatFile(filename: Path): + if "GFXSTREAM_NO_CLANG_FMT" in os.environ: + return + assert (clang_format_command is not None) assert (subprocess.call([clang_format_command, "-i", "--style=file", str(filename.resolve())]) == 0)