Index: clang-tools-extra/clang-apply-replacements/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-apply-replacements/CMakeLists.txt +++ clang-tools-extra/clang-apply-replacements/CMakeLists.txt @@ -4,8 +4,13 @@ add_clang_library(clangApplyReplacements lib/Tooling/ApplyReplacements.cpp + ) + +add_dependencies(clangApplyReplacements + ClangDiagnosticCommon + ) - LINK_LIBS +target_link_libraries(clangApplyReplacements ${cmake_2_8_12_INTERFACE} clangBasic clangRewriteCore clangTooling Index: clang-tools-extra/clang-modernize/Core/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-modernize/Core/CMakeLists.txt +++ clang-tools-extra/clang-modernize/Core/CMakeLists.txt @@ -7,8 +7,17 @@ IncludeExcludeInfo.cpp PerfSupport.cpp IncludeDirectives.cpp + ) + +add_dependencies(modernizeCore + ClangStmtNodes + ClangAttrClasses + ClangDeclNodes + ClangDiagnosticCommon + ClangAttrList + ) - LINK_LIBS +target_link_libraries(modernizeCore ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang-tools-extra/clang-query/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-query/CMakeLists.txt +++ clang-tools-extra/clang-query/CMakeLists.txt @@ -6,8 +6,18 @@ add_clang_library(clangQuery Query.cpp QueryParser.cpp + ) + +add_dependencies(clangQuery + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangQuery ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang-tools-extra/clang-tidy/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/CMakeLists.txt +++ clang-tools-extra/clang-tidy/CMakeLists.txt @@ -6,11 +6,19 @@ ClangTidy.cpp ClangTidyModule.cpp ClangTidyDiagnosticConsumer.cpp + ) - DEPENDS +add_dependencies(clangTidy + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes ClangSACheckers + ) - LINK_LIBS +target_link_libraries(clangTidy ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang-tools-extra/clang-tidy/google/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/google/CMakeLists.txt +++ clang-tools-extra/clang-tidy/google/CMakeLists.txt @@ -2,8 +2,18 @@ add_clang_library(clangTidyGoogleModule GoogleTidyModule.cpp + ) + +add_dependencies(clangTidyGoogleModule + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangTidyGoogleModule ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang-tools-extra/clang-tidy/llvm/CMakeLists.txt =================================================================== --- clang-tools-extra/clang-tidy/llvm/CMakeLists.txt +++ clang-tools-extra/clang-tidy/llvm/CMakeLists.txt @@ -2,8 +2,18 @@ add_clang_library(clangTidyLLVMModule LLVMTidyModule.cpp + ) + +add_dependencies(clangTidyLLVMModule + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangTidyLLVMModule ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -281,7 +281,6 @@ if(CTG_TARGET) add_public_tablegen_target(${CTG_TARGET}) set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Clang tablegenning") - set_property(GLOBAL APPEND PROPERTY CLANG_TABLEGEN_TARGETS ${CTG_TARGET}) endif() endfunction(clang_tablegen) @@ -419,11 +418,6 @@ add_subdirectory(utils/TableGen) add_subdirectory(include) - -# All targets below may depend on all tablegen'd files. -get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS) -list(APPEND LLVM_COMMON_DEPENDS ${CLANG_TABLEGEN_TARGETS}) - add_subdirectory(lib) add_subdirectory(tools) add_subdirectory(runtime) Index: clang/examples/PrintFunctionNames/CMakeLists.txt =================================================================== --- clang/examples/PrintFunctionNames/CMakeLists.txt +++ clang/examples/PrintFunctionNames/CMakeLists.txt @@ -10,3 +10,13 @@ endif() add_llvm_loadable_module(PrintFunctionNames PrintFunctionNames.cpp) + +add_dependencies(PrintFunctionNames + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) Index: clang/examples/analyzer-plugin/CMakeLists.txt =================================================================== --- clang/examples/analyzer-plugin/CMakeLists.txt +++ clang/examples/analyzer-plugin/CMakeLists.txt @@ -1 +1,11 @@ add_llvm_loadable_module(SampleAnalyzerPlugin MainCallChecker.cpp) + +add_dependencies(SampleAnalyzerPlugin + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) Index: clang/lib/ARCMigrate/CMakeLists.txt =================================================================== --- clang/lib/ARCMigrate/CMakeLists.txt +++ clang/lib/ARCMigrate/CMakeLists.txt @@ -23,8 +23,22 @@ TransZeroOutPropsInDealloc.cpp TransformActions.cpp Transforms.cpp + ) + +add_dependencies(clangARCMigrate + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticGroups + ClangDiagnosticSema + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangARCMigrate ${cmake_2_8_12_INTERFACE} clangAST clangAnalysis clangBasic Index: clang/lib/AST/CMakeLists.txt =================================================================== --- clang/lib/AST/CMakeLists.txt +++ clang/lib/AST/CMakeLists.txt @@ -57,8 +57,30 @@ TypePrinter.cpp VTableBuilder.cpp VTTBuilder.cpp + ) + +add_dependencies(clangAST + ClangARMNeon + ClangAttrClasses + ClangAttrList + ClangAttrImpl + ClangAttrDump + ClangAttrVisitor + ClangCommentCommandInfo + ClangCommentCommandList + ClangCommentNodes + ClangCommentHTMLTags + ClangCommentHTMLTagsProperties + ClangCommentHTMLNamedCharacterReferences + ClangDeclNodes + ClangDiagnosticAST + ClangDiagnosticComment + ClangDiagnosticCommon + ClangDiagnosticSema + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangAST ${cmake_2_8_12_INTERFACE} clangBasic clangLex ) Index: clang/lib/ASTMatchers/CMakeLists.txt =================================================================== --- clang/lib/ASTMatchers/CMakeLists.txt +++ clang/lib/ASTMatchers/CMakeLists.txt @@ -5,7 +5,18 @@ add_clang_library(clangASTMatchers ASTMatchFinder.cpp ASTMatchersInternal.cpp + ) + +add_dependencies(clangASTMatchers + ClangAttrClasses + ClangAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangASTMatchers ${cmake_2_8_12_INTERFACE} clangAST ) Index: clang/lib/ASTMatchers/Dynamic/CMakeLists.txt =================================================================== --- clang/lib/ASTMatchers/Dynamic/CMakeLists.txt +++ clang/lib/ASTMatchers/Dynamic/CMakeLists.txt @@ -5,8 +5,17 @@ VariantValue.cpp Parser.cpp Registry.cpp + ) + +add_dependencies(clangDynamicASTMatchers + ClangAttrClasses + ClangAttrList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangDynamicASTMatchers ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang/lib/Analysis/CMakeLists.txt =================================================================== --- clang/lib/Analysis/CMakeLists.txt +++ clang/lib/Analysis/CMakeLists.txt @@ -24,8 +24,19 @@ ScanfFormatString.cpp ThreadSafety.cpp UninitializedValues.cpp + ) + +add_dependencies(clangAnalysis + ClangAttrClasses + ClangAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangAnalysis ${cmake_2_8_12_INTERFACE} clangBasic clangAST ) Index: clang/lib/Basic/CMakeLists.txt =================================================================== --- clang/lib/Basic/CMakeLists.txt +++ clang/lib/Basic/CMakeLists.txt @@ -51,3 +51,18 @@ PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") endif() + +add_dependencies(clangBasic + ClangARMNeon + ClangDiagnosticAnalysis + ClangDiagnosticAST + ClangDiagnosticComment + ClangDiagnosticCommon + ClangDiagnosticDriver + ClangDiagnosticFrontend + ClangDiagnosticGroups + ClangDiagnosticLex + ClangDiagnosticParse + ClangDiagnosticSema + ClangDiagnosticSerialization + ) Index: clang/lib/CodeGen/CMakeLists.txt =================================================================== --- clang/lib/CodeGen/CMakeLists.txt +++ clang/lib/CodeGen/CMakeLists.txt @@ -61,8 +61,22 @@ DEPENDS intrinsics_gen + ) + +add_dependencies(clangCodeGen + ClangARMNeon + ClangAttrClasses + ClangAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangDiagnosticSema + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangCodeGen ${cmake_2_8_12_INTERFACE} clangBasic clangAST clangFrontend Index: clang/lib/Driver/CMakeLists.txt =================================================================== --- clang/lib/Driver/CMakeLists.txt +++ clang/lib/Driver/CMakeLists.txt @@ -20,11 +20,16 @@ WindowsToolChain.cpp Tools.cpp Types.cpp + ) - DEPENDS +add_dependencies(clangDriver + ClangAttrList ClangCC1AsOptions + ClangDiagnosticCommon + ClangDiagnosticDriver ClangDriverOptions + ) - LINK_LIBS +target_link_libraries(clangDriver ${cmake_2_8_12_INTERFACE} clangBasic ) Index: clang/lib/Edit/CMakeLists.txt =================================================================== --- clang/lib/Edit/CMakeLists.txt +++ clang/lib/Edit/CMakeLists.txt @@ -6,8 +6,16 @@ Commit.cpp EditedSource.cpp RewriteObjCFoundationAPI.cpp + ) + +add_dependencies(clangEdit + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangEdit ${cmake_2_8_12_INTERFACE} clangBasic clangAST clangLex Index: clang/lib/Format/CMakeLists.txt =================================================================== --- clang/lib/Format/CMakeLists.txt +++ clang/lib/Format/CMakeLists.txt @@ -8,8 +8,18 @@ TokenAnnotator.cpp UnwrappedLineParser.cpp WhitespaceManager.cpp + ) + +add_dependencies(clangFormat + ClangAttrClasses + ClangAttrList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangFormat ${cmake_2_8_12_INTERFACE} clangBasic clangLex clangTooling Index: clang/lib/Frontend/CMakeLists.txt =================================================================== --- clang/lib/Frontend/CMakeLists.txt +++ clang/lib/Frontend/CMakeLists.txt @@ -33,11 +33,26 @@ TextDiagnosticPrinter.cpp VerifyDiagnosticConsumer.cpp Warnings.cpp + ) - DEPENDS +add_dependencies(clangFrontend + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticAST + ClangDiagnosticCommon + ClangDiagnosticDriver + ClangDiagnosticFrontend + ClangDiagnosticLex + ClangDiagnosticSema ClangDriverOptions + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangFrontend ${cmake_2_8_12_INTERFACE} clangAST clangBasic clangDriver Index: clang/lib/FrontendTool/CMakeLists.txt =================================================================== --- clang/lib/FrontendTool/CMakeLists.txt +++ clang/lib/FrontendTool/CMakeLists.txt @@ -3,7 +3,17 @@ Support ) -set(link_libs +add_clang_library(clangFrontendTool + ExecuteCompilerInvocation.cpp + ) + +add_dependencies(clangFrontendTool + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangDriverOptions + ) + +target_link_libraries(clangFrontendTool ${cmake_2_8_12_INTERFACE} clangBasic clangCodeGen clangDriver @@ -12,23 +22,13 @@ ) if(CLANG_ENABLE_ARCMT) - list(APPEND link_libs + target_link_libraries(clangFrontendTool ${cmake_2_8_12_INTERFACE} clangARCMigrate ) endif() if(CLANG_ENABLE_STATIC_ANALYZER) - list(APPEND link_libs + target_link_libraries(clangFrontendTool ${cmake_2_8_12_INTERFACE} clangStaticAnalyzerFrontend ) endif() - -add_clang_library(clangFrontendTool - ExecuteCompilerInvocation.cpp - - DEPENDS - ClangDriverOptions - - LINK_LIBS - ${link_libs} - ) Index: clang/lib/Index/CMakeLists.txt =================================================================== --- clang/lib/Index/CMakeLists.txt +++ clang/lib/Index/CMakeLists.txt @@ -8,8 +8,19 @@ ADDITIONAL_HEADERS SimpleFormatContext.h + ) + +add_dependencies(clangIndex + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangIndex ${cmake_2_8_12_INTERFACE} clangAST clangBasic clangFormat Index: clang/lib/Lex/CMakeLists.txt =================================================================== --- clang/lib/Lex/CMakeLists.txt +++ clang/lib/Lex/CMakeLists.txt @@ -25,7 +25,14 @@ ScratchBuffer.cpp TokenConcatenation.cpp TokenLexer.cpp + ) + +add_dependencies(clangLex + ClangAttrSpellings + ClangDiagnosticCommon + ClangDiagnosticLex + ) - LINK_LIBS +target_link_libraries(clangLex ${cmake_2_8_12_INTERFACE} clangBasic ) Index: clang/lib/Parse/CMakeLists.txt =================================================================== --- clang/lib/Parse/CMakeLists.txt +++ clang/lib/Parse/CMakeLists.txt @@ -19,8 +19,22 @@ ParseTemplate.cpp ParseTentative.cpp Parser.cpp + ) + +add_dependencies(clangParse + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangAttrParserStringSwitches + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticParse + ClangDiagnosticSema + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangParse ${cmake_2_8_12_INTERFACE} clangBasic clangAST clangLex Index: clang/lib/Rewrite/Core/CMakeLists.txt =================================================================== --- clang/lib/Rewrite/Core/CMakeLists.txt +++ clang/lib/Rewrite/Core/CMakeLists.txt @@ -8,8 +8,20 @@ RewriteRope.cpp Rewriter.cpp TokenRewriter.cpp + ) + +add_dependencies(clangRewriteCore + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangCommentNodes + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangRewriteCore ${cmake_2_8_12_INTERFACE} clangAST clangBasic clangLex Index: clang/lib/Rewrite/Frontend/CMakeLists.txt =================================================================== --- clang/lib/Rewrite/Frontend/CMakeLists.txt +++ clang/lib/Rewrite/Frontend/CMakeLists.txt @@ -11,8 +11,20 @@ RewriteModernObjC.cpp RewriteObjC.cpp RewriteTest.cpp + ) + +add_dependencies(clangRewriteFrontend + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangRewriteFrontend ${cmake_2_8_12_INTERFACE} clangAST clangBasic clangEdit Index: clang/lib/Sema/CMakeLists.txt =================================================================== --- clang/lib/Sema/CMakeLists.txt +++ clang/lib/Sema/CMakeLists.txt @@ -48,8 +48,29 @@ SemaTemplateVariadic.cpp SemaType.cpp TypeLocBuilder.cpp + ) + +add_dependencies(clangSema + ClangARMNeon + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrImpl + ClangAttrParsedAttrKinds + ClangAttrParsedAttrList + ClangAttrSpellingListIndex + ClangAttrTemplateInstantiate + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticAST + ClangDiagnosticComment + ClangDiagnosticCommon + ClangDiagnosticParse + ClangDiagnosticSema + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangSema ${cmake_2_8_12_INTERFACE} clangAST clangAnalysis clangBasic Index: clang/lib/Serialization/CMakeLists.txt =================================================================== --- clang/lib/Serialization/CMakeLists.txt +++ clang/lib/Serialization/CMakeLists.txt @@ -20,8 +20,23 @@ ADDITIONAL_HEADERS ASTCommon.h ASTReaderInternals.h + ) + +add_dependencies(clangSerialization + ClangAttrClasses + ClangAttrList + ClangAttrParsedAttrList + ClangAttrPCHRead + ClangAttrPCHWrite + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticSema + ClangDiagnosticSerialization + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangSerialization ${cmake_2_8_12_INTERFACE} clangAST clangBasic clangLex Index: clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt =================================================================== --- clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +++ clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt @@ -74,11 +74,20 @@ UnreachableCodeChecker.cpp VLASizeChecker.cpp VirtualCallChecker.cpp + ) - DEPENDS +add_dependencies(clangStaticAnalyzerCheckers + ClangAttrClasses + ClangAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes ClangSACheckers + ) - LINK_LIBS +target_link_libraries(clangStaticAnalyzerCheckers ${cmake_2_8_12_INTERFACE} clangAST clangAnalysis clangBasic Index: clang/lib/StaticAnalyzer/Core/CMakeLists.txt =================================================================== --- clang/lib/StaticAnalyzer/Core/CMakeLists.txt +++ clang/lib/StaticAnalyzer/Core/CMakeLists.txt @@ -39,8 +39,18 @@ Store.cpp SubEngine.cpp SymbolManager.cpp + ) + +add_dependencies(clangStaticAnalyzerCore + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangStaticAnalyzerCore ${cmake_2_8_12_INTERFACE} clangAST clangAnalysis clangBasic Index: clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt =================================================================== --- clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt +++ clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt @@ -8,8 +8,20 @@ AnalysisConsumer.cpp CheckerRegistration.cpp FrontendActions.cpp + ) + +add_dependencies(clangStaticAnalyzerFrontend + ClangAttrClasses + ClangAttrList + ClangAttrVisitor + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticFrontend + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangStaticAnalyzerFrontend ${cmake_2_8_12_INTERFACE} clangAST clangAnalysis clangBasic Index: clang/lib/Tooling/CMakeLists.txt =================================================================== --- clang/lib/Tooling/CMakeLists.txt +++ clang/lib/Tooling/CMakeLists.txt @@ -9,8 +9,20 @@ Refactoring.cpp RefactoringCallbacks.cpp Tooling.cpp + ) + +add_dependencies(clangTooling + ClangAttrClasses + ClangAttrList + ClangCommentCommandList + ClangDeclNodes + ClangDiagnosticCommon + ClangDiagnosticDriver + ClangDiagnosticFrontend + ClangStmtNodes + ) - LINK_LIBS +target_link_libraries(clangTooling ${cmake_2_8_12_INTERFACE} clangAST clangASTMatchers clangBasic Index: clang/tools/diagtool/CMakeLists.txt =================================================================== --- clang/tools/diagtool/CMakeLists.txt +++ clang/tools/diagtool/CMakeLists.txt @@ -11,6 +11,10 @@ TreeView.cpp ) +add_dependencies(diagtool + ClangDiagnosticIndexName + ) + target_link_libraries(diagtool clangBasic clangFrontend