diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 00:55:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 00:55:34 +0300 |
commit | 1e10206590a4f2ee249f4275af75353fde3a76f5 (patch) | |
tree | 8f04c9398b23d5270682c7b44fc875c3e2ff69b0 | |
parent | 67d77f47f0a462095f7fdaeee5b7966d74956cae (diff) | |
parent | fb057153b05555606d801d1e942113d40ec15cec (diff) |
Merge branch 'master' into blender2.8
-rwxr-xr-x | build_files/cmake/cmake_consistency_check.py | 40 | ||||
-rw-r--r-- | build_files/cmake/cmake_consistency_check_config.py | 12 |
2 files changed, 40 insertions, 12 deletions
diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index ab87095874f..90a9631fe79 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -29,7 +29,8 @@ if not sys.version.startswith("3"): sys.exit(1) from cmake_consistency_check_config import ( - IGNORE, + IGNORE_SOURCE, + IGNORE_CMAKE, UTF8_CHECK, SOURCE_DIR, BUILD_DIR, @@ -156,6 +157,7 @@ def cmake_get_src(f): break # replace dirs + l = l.replace("${CMAKE_SOURCE_DIR}", SOURCE_DIR) l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base) l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", cmake_base_bin) l = l.strip('"') @@ -238,8 +240,16 @@ def cmake_get_src(f): filen.close() -def is_ignore(f, ignore_used): - for index, ig in enumerate(IGNORE): +def is_ignore_source(f, ignore_used): + for index, ig in enumerate(IGNORE_SOURCE): + if ig in f: + ignore_used[index] = True + return True + return False + + +def is_ignore_cmake(f, ignore_used): + for index, ig in enumerate(IGNORE_CMAKE): if ig in f: ignore_used[index] = True return True @@ -250,8 +260,12 @@ def main(): print("Scanning:", SOURCE_DIR) + ignore_used_source = [False] * len(IGNORE_SOURCE) + ignore_used_cmake = [False] * len(IGNORE_CMAKE) + for cmake in source_list(SOURCE_DIR, is_cmake): - cmake_get_src(cmake) + if not is_ignore_cmake(cmake, ignore_used_cmake): + cmake_get_src(cmake) # First do stupid check, do these files exist? print("\nChecking for missing references:") @@ -282,12 +296,10 @@ def main(): del is_err del errs - ignore_used = [False] * len(IGNORE) - # now check on files not accounted for. print("\nC/C++ Files CMake does not know about...") for cf in sorted(source_list(SOURCE_DIR, is_c)): - if not is_ignore(cf, ignore_used): + if not is_ignore_source(cf, ignore_used_source): if cf not in global_c: print("missing_c: ", cf) @@ -304,7 +316,7 @@ def main(): print("\nC/C++ Headers CMake does not know about...") for hf in sorted(source_list(SOURCE_DIR, is_c_header)): - if not is_ignore(hf, ignore_used): + if not is_ignore_source(hf, ignore_used_source): if hf not in global_h: print("missing_h: ", hf) @@ -326,9 +338,15 @@ def main(): 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("\nCheck for unused 'IGNORE_SOURCE' paths...") + for index, ig in enumerate(IGNORE_SOURCE): + if not ignore_used_source[index]: + print("unused ignore: %r" % ig) + + # Check ignores aren't stale + print("\nCheck for unused 'IGNORE_CMAKE' paths...") + for index, ig in enumerate(IGNORE_CMAKE): + if not ignore_used_cmake[index]: print("unused ignore: %r" % ig) diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 2fbf855c386..bb98cb22644 100644 --- a/build_files/cmake/cmake_consistency_check_config.py +++ b/build_files/cmake/cmake_consistency_check_config.py @@ -1,11 +1,14 @@ import os -IGNORE = ( +IGNORE_SOURCE = ( "/test/", "/tests/gtests/", "/release/", # specific source files + "extern/audaspace/" + + # specific source files "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp", "extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp", "extern/bullet2/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp", @@ -17,6 +20,10 @@ IGNORE = ( "intern/audaspace/SRC/AUD_SRCResampleFactory.cpp", "intern/audaspace/SRC/AUD_SRCResampleReader.cpp", + "doc/doxygen/doxygen.extern.h", + "doc/doxygen/doxygen.intern.h", + "doc/doxygen/doxygen.main.h", + "doc/doxygen/doxygen.source.h", "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h", "extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h", "extern/bullet2/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h", @@ -29,6 +36,9 @@ IGNORE = ( "intern/audaspace/SRC/AUD_SRCResampleReader.h", ) +IGNORE_CMAKE = ( +) + UTF8_CHECK = True SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))) |