Skip to content

Commit a3fc923

Browse files
committed
cmake: Don't reject unknown cpp files that start with .
Some editors create hidden file backups in the same directory as the file, and it's annoying when cmake errors on them. llvm-svn: 216941
1 parent 4f6b93b commit a3fc923

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

llvm/cmake/modules/LLVMProcessSources.cmake

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,17 @@ function(llvm_check_source_file_list)
5959
file(GLOB globbed *.c *.cpp)
6060
foreach(g ${globbed})
6161
get_filename_component(fn ${g} NAME)
62-
list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx)
63-
if( idx LESS 0 )
64-
list(FIND listed ${fn} idx)
62+
63+
# Don't reject hidden files. Some editors create backups in the
64+
# same directory as the file.
65+
if (NOT "${fn}" MATCHES "^\\.")
66+
list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx)
6567
if( idx LESS 0 )
66-
message(SEND_ERROR "Found unknown source file ${g}
68+
list(FIND listed ${fn} idx)
69+
if( idx LESS 0 )
70+
message(SEND_ERROR "Found unknown source file ${g}
6771
Please update ${CMAKE_CURRENT_LIST_FILE}\n")
72+
endif()
6873
endif()
6974
endif()
7075
endforeach()

0 commit comments

Comments
 (0)