
From: Simon Glass <sjg@chromium.org> If CPP is set (e.g. to 'gcc -E') buildman currently gives an error. Add a little more logic to handle this case. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/buildman/boards.py | 4 ++-- tools/buildman/func_test.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index eaeeb5ec8dc..2330315fe95 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -247,8 +247,8 @@ class KconfigScanner: temp = None if b'#include' in tools.read_file(defconfig): - cmd = [ - os.getenv('CPP', 'cpp'), + cpp = os.getenv('CPP', 'cpp').split() + cmd = cpp + [ '-nostdinc', '-P', '-I', self._srctree, '-undef', diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 968765b713c..6fc08e02fb8 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -427,7 +427,8 @@ class TestFunctional(unittest.TestCase): return self._HandleCommandSize(args) elif cmd.endswith( 'cpp'): return self._HandleCommandCpp(args) - + elif cmd == 'gcc' and args[0] == '-E': + return self._HandleCommandCpp(args[1:]) if not result: # Not handled, so abort print('unknown command', kwargs) -- 2.43.0