CMake: consistency check now reports stale ignores
authorCampbell Barton <ideasman42@gmail.com>
Tue, 12 Apr 2016 10:08:25 +0000 (20:08 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 12 Apr 2016 10:12:29 +0000 (20:12 +1000)
Also update ignore list.

build_files/cmake/cmake_consistency_check.py
build_files/cmake/cmake_consistency_check_config.py

index 7ad47267239a468726edf5e8cad24134264cb2d9..6cd66b7640c01f3b66e26d334b00cd27c05a0ccf 100755 (executable)
@@ -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
 
@@ -283,10 +284,12 @@ def main():
     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)
 
@@ -303,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)
 
@@ -324,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()
index 5345f682f58f89c1b7365b95c100c50c9148687b..7e7cd40dbea72ad24614512e9759645f572a3535 100644 (file)
@@ -3,11 +3,7 @@ import os
 IGNORE = (
     "/test/",
     "/tests/gtests/",
-    "/BSP_GhostTest/",
     "/release/",
-    "/xembed/",
-    "/TerraplayNetwork/",
-    "/ik_glut_test/",
 
     # specific source files
     "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
@@ -18,31 +14,8 @@ IGNORE = (
     "extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp",
     "extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
     "extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
-    "extern/eltopo/common/meshes/ObjLoader.cpp",
-    "extern/eltopo/common/meshes/meshloader.cpp",
-    "extern/eltopo/common/openglutils.cpp",
-    "extern/eltopo/eltopo3d/broadphase_blenderbvh.cpp",
-    "source/blender/imbuf/intern/imbuf_cocoa.m",
-    "extern/recastnavigation/Recast/Source/RecastLog.cpp",
-    "extern/recastnavigation/Recast/Source/RecastTimer.cpp",
     "intern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
     "intern/audaspace/SRC/AUD_SRCResampleReader.cpp",
-    "intern/cycles/render/film_response.cpp",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_2.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_3.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_4.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_d.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_3.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_4.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_9.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_d.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_3.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_4.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_d.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_2.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_3.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_4.cc",
-    "extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_d.cc",
 
     "extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
     "extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
@@ -52,20 +25,12 @@ IGNORE = (
     "extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.h",
     "extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h",
     "extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h",
-    "extern/eltopo/common/meshes/Edge.hpp",
-    "extern/eltopo/common/meshes/ObjLoader.hpp",
-    "extern/eltopo/common/meshes/TriangleIndex.hpp",
-    "extern/eltopo/common/meshes/meshloader.h",
-    "extern/eltopo/eltopo3d/broadphase_blenderbvh.h",
-    "extern/recastnavigation/Recast/Include/RecastLog.h",
-    "extern/recastnavigation/Recast/Include/RecastTimer.h",
-    "intern/audaspace/SRC/AUD_SRCResampleFactory.h",
-    "intern/audaspace/SRC/AUD_SRCResampleReader.h",
-    "intern/cycles/render/film_response.h",
     "extern/carve/include/carve/config.h",
-    "extern/carve/include/carve/external/boost/random.hpp",
+    "extern/carve/include/carve/random/random.h",
     "extern/carve/patches/files/config.h",
-    "extern/carve/patches/files/random.hpp",
+    "extern/carve/patches/files/random.h",
+    "intern/audaspace/SRC/AUD_SRCResampleFactory.h",
+    "intern/audaspace/SRC/AUD_SRCResampleReader.h",
     )
 
 UTF8_CHECK = True