[PATCH] D28558: [CMake] Ignore hidden/metadata files when adding lit check-* testsuites

Elad Cohen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 04:37:59 PST 2017


eladcohen created this revision.
eladcohen added reviewers: vladisld, bogner.
eladcohen added a subscriber: llvm-commits.
Herald added a subscriber: mgorny.

When we have hidden/metadata files (for example .svn dirs) under the test dirs, cmake creates a bloated Makefile with tons of fake check-.* targets which increases build time.


https://reviews.llvm.org/D28558

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1207,15 +1207,16 @@
     cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
 
     # Search recursively for test directories by assuming anything not
-    # in a directory called Inputs contains tests.
+    # in a directory called Inputs/Output/.* contains tests.
     file(GLOB_RECURSE to_process LIST_DIRECTORIES true ${directory}/*)
     foreach(lit_suite ${to_process})
       if(NOT IS_DIRECTORY ${lit_suite})
         continue()
       endif()
       string(FIND ${lit_suite} Inputs is_inputs)
       string(FIND ${lit_suite} Output is_output)
-      if (NOT (is_inputs EQUAL -1 AND is_output EQUAL -1))
+      string(COMPARE EQUAL ${lit_suite} "^[.].*" is_hidden)
+      if (NOT (is_inputs EQUAL -1 AND is_output EQUAL -1 AND is_hidden EQUAL -1))
         continue()
       endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28558.83955.patch
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170111/a17846bd/attachment.bin>


More information about the llvm-commits mailing list