diff options
Diffstat (limited to 'llvm/utils/gn/build')
| -rwxr-xr-x | llvm/utils/gn/build/sync_source_lists_from_cmake.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/gn/build/sync_source_lists_from_cmake.py b/llvm/utils/gn/build/sync_source_lists_from_cmake.py index f5d92ce0bba..03cba7ad396 100755 --- a/llvm/utils/gn/build/sync_source_lists_from_cmake.py +++ b/llvm/utils/gn/build/sync_source_lists_from_cmake.py @@ -21,9 +21,9 @@ def sync_source_lists(): gn_files = subprocess.check_output( ['git', 'ls-files', '*BUILD.gn']).splitlines() - # Matches e.g. | "foo.cpp",|. + # Matches e.g. | "foo.cpp",|, captures |foo| in group 1. gn_cpp_re = re.compile(r'^\s*"([^"]+\.(?:cpp|h))",$', re.MULTILINE) - # Matches e.g. | "foo.cpp"|. + # Matches e.g. | foo.cpp|, captures |foo| in group 1. cmake_cpp_re = re.compile(r'^\s*([A-Za-z_0-9/-]+\.(?:cpp|h))$', re.MULTILINE) @@ -57,12 +57,18 @@ def sync_source_lists(): def sync_unittests(): + # Matches e.g. |add_llvm_unittest_with_input_files|. + unittest_re = re.compile(r'^add_\S+_unittest', re.MULTILINE) + + # FIXME: Add 'llvm' here once it's complete. checked = [ 'clang', 'lld' ] for c in checked: for root, _, _ in os.walk(os.path.join(c, 'unittests')): cmake_file = os.path.join(root, 'CMakeLists.txt') if not os.path.exists(cmake_file): continue + if not unittest_re.search(open(cmake_file).read()): + continue # Skip CMake files that just add subdirectories. gn_file = os.path.join('llvm/utils/gn/secondary', root, 'BUILD.gn') if not os.path.exists(gn_file): print('missing GN file %s for unittest CMake file %s' % |

