diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-28 19:41:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-28 19:46:50 +0300 |
commit | c050247edcdd477c2d16cec9d6c02fde2df3ad6d (patch) | |
tree | eacf580984c171ae14467064520db03353bc82ab /build_files/cmake | |
parent | 312075e6883986fe2d1861811c7255b8898ab2cc (diff) |
CMake: update cmake_consistency_check
Support for listing files which are known not to exist
(needed by standalone cycles).
Diffstat (limited to 'build_files/cmake')
-rwxr-xr-x | build_files/cmake/cmake_consistency_check.py | 24 | ||||
-rw-r--r-- | build_files/cmake/cmake_consistency_check_config.py | 10 |
2 files changed, 29 insertions, 5 deletions
diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index c5689268933..b4c91e6ba4f 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -28,6 +28,7 @@ if not sys.version.startswith("3"): from cmake_consistency_check_config import ( IGNORE_SOURCE, + IGNORE_SOURCE_MISSING, IGNORE_CMAKE, UTF8_CHECK, SOURCE_DIR, @@ -42,6 +43,11 @@ global_h = set() global_c = set() global_refs = {} +# Ignore cmake file, path pairs. +global_ignore_source_missing = {} +for k, v in IGNORE_SOURCE_MISSING: + global_ignore_source_missing.setdefault(k, []).append(v) + def replace_line(f, i, text, keep_indent=True): file_handle = open(f, 'r') @@ -137,6 +143,13 @@ def cmake_get_src(f): cmake_base = dirname(f) cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR)) + # Find known missing sources list (if we have one). + f_rel = os.path.relpath(f, SOURCE_DIR) + f_rel_key = f_rel + if os.sep != "/": + f_rel_key = f_rel_key.replace(os.sep, "/") + local_ignore_source_missing = global_ignore_source_missing.get(f_rel_key, []) + while it is not None: i += 1 try: @@ -214,7 +227,10 @@ def cmake_get_src(f): # replace_line(f, i - 1, new_path_rel) else: - raise Exception("non existent include %s:%d -> %s" % (f, i, new_file)) + if l in local_ignore_source_missing: + local_ignore_source_missing.remove(l) + else: + raise Exception("non existent include %s:%d -> %s" % (f, i, new_file)) # print(new_file) @@ -345,6 +361,12 @@ def main(): print("unused ignore: %r" % ig) # Check ignores aren't stale + print("\nCheck for unused 'IGNORE_SOURCE_MISSING' paths...") + for k, v in sorted(global_ignore_source_missing.items()): + for ig in v: + print("unused ignore: %r -> %r" % (ig, k)) + + # 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]: diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 7ecfe6f1e5f..c3a1036af42 100644 --- a/build_files/cmake/cmake_consistency_check_config.py +++ b/build_files/cmake/cmake_consistency_check_config.py @@ -17,8 +17,6 @@ IGNORE_SOURCE = ( "extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp", "extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp", "extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp", - "intern/audaspace/SRC/AUD_SRCResampleFactory.cpp", - "intern/audaspace/SRC/AUD_SRCResampleReader.cpp", "doc/doxygen/doxygen.extern.h", "doc/doxygen/doxygen.intern.h", @@ -32,8 +30,12 @@ IGNORE_SOURCE = ( "extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.h", "extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h", "extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h", - "intern/audaspace/SRC/AUD_SRCResampleFactory.h", - "intern/audaspace/SRC/AUD_SRCResampleReader.h", +) + +# Ignore cmake file, path pairs. +IGNORE_SOURCE_MISSING = ( + # Use for cycles stand-alone. + ("intern/cycles/util/CMakeLists.txt", "../../third_party/numaapi/include"), ) IGNORE_CMAKE = ( |