diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py index 45f80b18c7e..6ab9eee08d8 100644 --- a/build_files/cmake/project_source_info.py +++ b/build_files/cmake/project_source_info.py @@ -150,11 +150,12 @@ def build_info( print("parsing make log ...") for line in makelog: - - args: Union[str, List[str]] = line.split() - - if not any([(c in args) for c in compilers]): + args_orig: Union[str, List[str]] = line.split() + args = [fake_compiler if c in compilers else c for c in args_orig] + if args == args_orig: + # No compilers in the command, skip. continue + del args_orig # join args incase they are not. args = ' '.join(args) @@ -162,8 +163,6 @@ def build_info( args = args.replace(" -D ", " -D") args = args.replace(" -I ", " -I") - for c in compilers: - args = args.replace(c, fake_compiler) args = shlex.split(args) # end