diff options
Diffstat (limited to 'build_files/cmake/cmake_consistency_check.py')
-rwxr-xr-x | build_files/cmake/cmake_consistency_check.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index d0bbdda1870..6cd66b7640c 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -240,9 +240,10 @@ def cmake_get_src(f): filen.close() -def is_ignore(f): - for ig in IGNORE: +def is_ignore(f, ignore_used): + for index, ig in enumerate(IGNORE): if ig in f: + ignore_used[index] = True return True return False @@ -278,16 +279,17 @@ def main(): # Write a 'sed' script, useful if we get a lot of these # print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf)) - if is_err: raise Exception("CMake referenecs missing files, aborting!") del is_err del errs + ignore_used = [False] * len(IGNORE) + # now check on files not accounted for. print("\nC/C++ Files CMake doesnt know about...") for cf in sorted(source_list(SOURCE_DIR, is_c)): - if not is_ignore(cf): + if not is_ignore(cf, ignore_used): if cf not in global_c: print("missing_c: ", cf) @@ -304,7 +306,7 @@ def main(): print("\nC/C++ Headers CMake doesnt know about...") for hf in sorted(source_list(SOURCE_DIR, is_c_header)): - if not is_ignore(hf): + if not is_ignore(hf, ignore_used): if hf not in global_h: print("missing_h: ", hf) @@ -325,5 +327,12 @@ def main(): if i > 1: traceback.print_exc() + # Check ignores aren't stale + print("\nCheck for unused 'IGNORE' paths...") + for index, ig in enumerate(IGNORE): + if not ignore_used[index]: + print("unused ignore: %r" % ig) + + if __name__ == "__main__": main() |