1add_custom_target(ClangUnitTests) 2set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests") 3 4if(CLANG_BUILT_STANDALONE) 5 # LLVMTestingSupport library is needed for some of the unittests. 6 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support 7 AND NOT TARGET LLVMTestingSupport) 8 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support 9 lib/Testing/Support) 10 endif() 11endif() 12 13# add_clang_unittest(test_dirname file1.cpp file2.cpp) 14# 15# Will compile the list of files together and link against the clang 16# Produces a binary named 'basename(test_dirname)'. 17function(add_clang_unittest test_dirname) 18 add_unittest(ClangUnitTests ${test_dirname} ${ARGN}) 19endfunction() 20 21add_subdirectory(Basic) 22add_subdirectory(Lex) 23add_subdirectory(Driver) 24if(CLANG_ENABLE_STATIC_ANALYZER) 25 add_subdirectory(Analysis) 26 add_subdirectory(StaticAnalyzer) 27 add_subdirectory(Frontend) 28endif() 29add_subdirectory(ASTMatchers) 30add_subdirectory(AST) 31add_subdirectory(CrossTU) 32add_subdirectory(Tooling) 33add_subdirectory(Format) 34add_subdirectory(Rewrite) 35add_subdirectory(Sema) 36add_subdirectory(CodeGen) 37# FIXME: libclang unit tests are disabled on Windows due 38# to failures, mostly in libclang.VirtualFileOverlay_*. 39if(NOT WIN32 AND CLANG_TOOL_LIBCLANG_BUILD) 40 add_subdirectory(libclang) 41endif() 42add_subdirectory(DirectoryWatcher) 43add_subdirectory(Rename) 44add_subdirectory(Index) 45add_subdirectory(Serialization) 46