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

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 13:45:04 PST 2017


Elad Cohen via Phabricator <reviews at reviews.llvm.org> writes:
> 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))

This line is kind of long, so I'd probably split it a bit.

LGTM though, feel free to commit.

>          continue()
>        endif()


More information about the llvm-commits mailing list