diff options
31 files changed, 58 insertions, 76 deletions
diff --git a/clang-tools-extra/clang-apply-replacements/CMakeLists.txt b/clang-tools-extra/clang-apply-replacements/CMakeLists.txt index 3b84787ba00..2458fc0ec80 100644 --- a/clang-tools-extra/clang-apply-replacements/CMakeLists.txt +++ b/clang-tools-extra/clang-apply-replacements/CMakeLists.txt @@ -4,8 +4,8 @@ set(LLVM_LINK_COMPONENTS add_clang_library(clangApplyReplacements lib/Tooling/ApplyReplacements.cpp - ) -target_link_libraries(clangApplyReplacements + + LINK_LIBS clangBasic clangRewriteCore clangTooling diff --git a/clang-tools-extra/clang-modernize/Core/CMakeLists.txt b/clang-tools-extra/clang-modernize/Core/CMakeLists.txt index 71a9d0dec11..5a7b160fb57 100644 --- a/clang-tools-extra/clang-modernize/Core/CMakeLists.txt +++ b/clang-tools-extra/clang-modernize/Core/CMakeLists.txt @@ -7,8 +7,8 @@ add_clang_library(modernizeCore IncludeExcludeInfo.cpp PerfSupport.cpp IncludeDirectives.cpp - ) -target_link_libraries(modernizeCore + + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang-tools-extra/clang-query/CMakeLists.txt b/clang-tools-extra/clang-query/CMakeLists.txt index 0fb8c3c24d0..46febd60939 100644 --- a/clang-tools-extra/clang-query/CMakeLists.txt +++ b/clang-tools-extra/clang-query/CMakeLists.txt @@ -6,8 +6,8 @@ set(LLVM_LINK_COMPONENTS add_clang_library(clangQuery Query.cpp QueryParser.cpp - ) -target_link_libraries(clangQuery + + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt index f642924da74..c3226dd8d69 100644 --- a/clang-tools-extra/clang-tidy/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/CMakeLists.txt @@ -9,8 +9,8 @@ add_clang_library(clangTidy DEPENDS ClangSACheckers - ) -target_link_libraries(clangTidy + + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang-tools-extra/clang-tidy/google/CMakeLists.txt b/clang-tools-extra/clang-tidy/google/CMakeLists.txt index 7d053c7d869..935cabcf834 100644 --- a/clang-tools-extra/clang-tidy/google/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/google/CMakeLists.txt @@ -2,8 +2,8 @@ set(LLVM_LINK_COMPONENTS support) add_clang_library(clangTidyGoogleModule GoogleTidyModule.cpp - ) -target_link_libraries(clangTidyGoogleModule + + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt b/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt index cf3930aa2bf..cf9baaef7e9 100644 --- a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt @@ -2,8 +2,8 @@ set(LLVM_LINK_COMPONENTS support) add_clang_library(clangTidyLLVMModule LLVMTidyModule.cpp - ) -target_link_libraries(clangTidyLLVMModule + + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang/lib/ARCMigrate/CMakeLists.txt b/clang/lib/ARCMigrate/CMakeLists.txt index 0bfdb6c1369..e5ec607d73f 100644 --- a/clang/lib/ARCMigrate/CMakeLists.txt +++ b/clang/lib/ARCMigrate/CMakeLists.txt @@ -23,9 +23,8 @@ add_clang_library(clangARCMigrate TransZeroOutPropsInDealloc.cpp TransformActions.cpp Transforms.cpp - ) -target_link_libraries(clangARCMigrate + LINK_LIBS clangAST clangAnalysis clangBasic diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt index 1da3ac67129..9006be64f73 100644 --- a/clang/lib/AST/CMakeLists.txt +++ b/clang/lib/AST/CMakeLists.txt @@ -57,9 +57,8 @@ add_clang_library(clangAST TypePrinter.cpp VTableBuilder.cpp VTTBuilder.cpp - ) -target_link_libraries(clangAST + LINK_LIBS clangBasic clangLex ) diff --git a/clang/lib/ASTMatchers/CMakeLists.txt b/clang/lib/ASTMatchers/CMakeLists.txt index e2a8fc5020d..8a8e8c36569 100644 --- a/clang/lib/ASTMatchers/CMakeLists.txt +++ b/clang/lib/ASTMatchers/CMakeLists.txt @@ -5,8 +5,7 @@ set(LLVM_LINK_COMPONENTS support) add_clang_library(clangASTMatchers ASTMatchFinder.cpp ASTMatchersInternal.cpp - ) -target_link_libraries(clangASTMatchers + LINK_LIBS clangAST ) diff --git a/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt b/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt index b28b2ec2ffd..c0d80adaac0 100644 --- a/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt +++ b/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt @@ -5,9 +5,8 @@ add_clang_library(clangDynamicASTMatchers VariantValue.cpp Parser.cpp Registry.cpp - ) -target_link_libraries(clangDynamicASTMatchers + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/clang/lib/Analysis/CMakeLists.txt b/clang/lib/Analysis/CMakeLists.txt index 231db95f38d..9630bc0be0a 100644 --- a/clang/lib/Analysis/CMakeLists.txt +++ b/clang/lib/Analysis/CMakeLists.txt @@ -24,9 +24,8 @@ add_clang_library(clangAnalysis ScanfFormatString.cpp ThreadSafety.cpp UninitializedValues.cpp - ) -target_link_libraries(clangAnalysis + LINK_LIBS clangBasic clangAST ) diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt index 5890736b182..12cb1ab2559 100644 --- a/clang/lib/CodeGen/CMakeLists.txt +++ b/clang/lib/CodeGen/CMakeLists.txt @@ -61,9 +61,8 @@ add_clang_library(clangCodeGen DEPENDS intrinsics_gen - ) -target_link_libraries(clangCodeGen + LINK_LIBS clangBasic clangAST clangFrontend diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt index 9468601d40a..f2bdaee7928 100644 --- a/clang/lib/Driver/CMakeLists.txt +++ b/clang/lib/Driver/CMakeLists.txt @@ -24,8 +24,7 @@ add_clang_library(clangDriver DEPENDS ClangCC1AsOptions ClangDriverOptions - ) -target_link_libraries(clangDriver + LINK_LIBS clangBasic ) diff --git a/clang/lib/Edit/CMakeLists.txt b/clang/lib/Edit/CMakeLists.txt index b81f8a95cf3..08495f89c35 100644 --- a/clang/lib/Edit/CMakeLists.txt +++ b/clang/lib/Edit/CMakeLists.txt @@ -6,9 +6,8 @@ add_clang_library(clangEdit Commit.cpp EditedSource.cpp RewriteObjCFoundationAPI.cpp - ) -target_link_libraries(clangEdit + LINK_LIBS clangBasic clangAST clangLex diff --git a/clang/lib/Format/CMakeLists.txt b/clang/lib/Format/CMakeLists.txt index e87c9401027..47e15bd08a3 100644 --- a/clang/lib/Format/CMakeLists.txt +++ b/clang/lib/Format/CMakeLists.txt @@ -8,9 +8,8 @@ add_clang_library(clangFormat TokenAnnotator.cpp UnwrappedLineParser.cpp WhitespaceManager.cpp - ) -target_link_libraries(clangFormat + LINK_LIBS clangBasic clangLex clangTooling diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt index 8e11e6f09d5..f1c789778f1 100644 --- a/clang/lib/Frontend/CMakeLists.txt +++ b/clang/lib/Frontend/CMakeLists.txt @@ -36,9 +36,8 @@ add_clang_library(clangFrontend DEPENDS ClangDriverOptions - ) -target_link_libraries(clangFrontend + LINK_LIBS clangAST clangBasic clangDriver diff --git a/clang/lib/FrontendTool/CMakeLists.txt b/clang/lib/FrontendTool/CMakeLists.txt index 63b6e9b7df4..7e11be0ce4c 100644 --- a/clang/lib/FrontendTool/CMakeLists.txt +++ b/clang/lib/FrontendTool/CMakeLists.txt @@ -3,14 +3,7 @@ set(LLVM_LINK_COMPONENTS Support ) -add_clang_library(clangFrontendTool - ExecuteCompilerInvocation.cpp - - DEPENDS - ClangDriverOptions - ) - -target_link_libraries(clangFrontendTool +set(link_libs clangBasic clangCodeGen clangDriver @@ -19,13 +12,23 @@ target_link_libraries(clangFrontendTool ) if(CLANG_ENABLE_ARCMT) - target_link_libraries(clangFrontendTool + list(APPEND link_libs clangARCMigrate ) endif() if(CLANG_ENABLE_STATIC_ANALYZER) - target_link_libraries(clangFrontendTool + list(APPEND link_libs clangStaticAnalyzerFrontend ) endif() + +add_clang_library(clangFrontendTool + ExecuteCompilerInvocation.cpp + + DEPENDS + ClangDriverOptions + + LINK_LIBS + ${link_libs} + ) diff --git a/clang/lib/Index/CMakeLists.txt b/clang/lib/Index/CMakeLists.txt index e9da8e591db..fd9810d699c 100644 --- a/clang/lib/Index/CMakeLists.txt +++ b/clang/lib/Index/CMakeLists.txt @@ -8,9 +8,8 @@ add_clang_library(clangIndex ADDITIONAL_HEADERS SimpleFormatContext.h - ) -target_link_libraries(clangIndex + LINK_LIBS clangAST clangBasic clangFormat diff --git a/clang/lib/Lex/CMakeLists.txt b/clang/lib/Lex/CMakeLists.txt index f5050179b1e..38df144adf9 100644 --- a/clang/lib/Lex/CMakeLists.txt +++ b/clang/lib/Lex/CMakeLists.txt @@ -25,8 +25,7 @@ add_clang_library(clangLex ScratchBuffer.cpp TokenConcatenation.cpp TokenLexer.cpp - ) -target_link_libraries(clangLex + LINK_LIBS clangBasic ) diff --git a/clang/lib/Parse/CMakeLists.txt b/clang/lib/Parse/CMakeLists.txt index 43500bfaa60..10b146fd187 100644 --- a/clang/lib/Parse/CMakeLists.txt +++ b/clang/lib/Parse/CMakeLists.txt @@ -19,9 +19,8 @@ add_clang_library(clangParse ParseTemplate.cpp ParseTentative.cpp Parser.cpp - ) -target_link_libraries(clangParse + LINK_LIBS clangBasic clangAST clangLex diff --git a/clang/lib/Rewrite/Core/CMakeLists.txt b/clang/lib/Rewrite/Core/CMakeLists.txt index 6e9505fd9f2..896382c36db 100644 --- a/clang/lib/Rewrite/Core/CMakeLists.txt +++ b/clang/lib/Rewrite/Core/CMakeLists.txt @@ -8,9 +8,8 @@ add_clang_library(clangRewriteCore RewriteRope.cpp Rewriter.cpp TokenRewriter.cpp - ) -target_link_libraries(clangRewriteCore + LINK_LIBS clangAST clangBasic clangLex diff --git a/clang/lib/Rewrite/Frontend/CMakeLists.txt b/clang/lib/Rewrite/Frontend/CMakeLists.txt index c1146181f34..85af97d343d 100644 --- a/clang/lib/Rewrite/Frontend/CMakeLists.txt +++ b/clang/lib/Rewrite/Frontend/CMakeLists.txt @@ -11,9 +11,8 @@ add_clang_library(clangRewriteFrontend RewriteModernObjC.cpp RewriteObjC.cpp RewriteTest.cpp - ) -target_link_libraries(clangRewriteFrontend + LINK_LIBS clangAST clangBasic clangEdit diff --git a/clang/lib/Sema/CMakeLists.txt b/clang/lib/Sema/CMakeLists.txt index 1c16f0f987f..7847d2c36e5 100644 --- a/clang/lib/Sema/CMakeLists.txt +++ b/clang/lib/Sema/CMakeLists.txt @@ -48,9 +48,8 @@ add_clang_library(clangSema SemaTemplateVariadic.cpp SemaType.cpp TypeLocBuilder.cpp - ) -target_link_libraries(clangSema + LINK_LIBS clangAST clangAnalysis clangBasic diff --git a/clang/lib/Serialization/CMakeLists.txt b/clang/lib/Serialization/CMakeLists.txt index cd7082006dc..d885db22975 100644 --- a/clang/lib/Serialization/CMakeLists.txt +++ b/clang/lib/Serialization/CMakeLists.txt @@ -20,9 +20,8 @@ add_clang_library(clangSerialization ADDITIONAL_HEADERS ASTCommon.h ASTReaderInternals.h - ) -target_link_libraries(clangSerialization + LINK_LIBS clangAST clangBasic clangLex diff --git a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt index b231864123a..8e7a8391339 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt @@ -77,9 +77,8 @@ add_clang_library(clangStaticAnalyzerCheckers DEPENDS ClangSACheckers - ) -target_link_libraries(clangStaticAnalyzerCheckers + LINK_LIBS clangAST clangAnalysis clangBasic diff --git a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt index 89c0be138d3..3a00131ce12 100644 --- a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt @@ -39,9 +39,8 @@ add_clang_library(clangStaticAnalyzerCore Store.cpp SubEngine.cpp SymbolManager.cpp - ) -target_link_libraries(clangStaticAnalyzerCore + LINK_LIBS clangAST clangAnalysis clangBasic diff --git a/clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt b/clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt index 4df4556648c..5349ed93e2c 100644 --- a/clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt @@ -8,9 +8,8 @@ add_clang_library(clangStaticAnalyzerFrontend AnalysisConsumer.cpp CheckerRegistration.cpp FrontendActions.cpp - ) -target_link_libraries(clangStaticAnalyzerFrontend + LINK_LIBS clangAST clangAnalysis clangBasic diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt index 83c71b6c1e1..a1bf964faf3 100644 --- a/clang/lib/Tooling/CMakeLists.txt +++ b/clang/lib/Tooling/CMakeLists.txt @@ -9,9 +9,8 @@ add_clang_library(clangTooling Refactoring.cpp RefactoringCallbacks.cpp Tooling.cpp - ) -target_link_libraries(clangTooling + LINK_LIBS clangAST clangASTMatchers clangBasic diff --git a/llvm/lib/LineEditor/CMakeLists.txt b/llvm/lib/LineEditor/CMakeLists.txt index cef36a40b47..0dec256e415 100644 --- a/llvm/lib/LineEditor/CMakeLists.txt +++ b/llvm/lib/LineEditor/CMakeLists.txt @@ -1,7 +1,11 @@ +if(HAVE_LIBEDIT) + set(link_libs edit) +endif() + add_llvm_library(LLVMLineEditor LineEditor.cpp - ) -if(HAVE_LIBEDIT) - target_link_libraries(LLVMLineEditor edit) -endif() + LINK_LIBS + LLVMSupport + ${link_libs} +) diff --git a/llvm/utils/unittest/CMakeLists.txt b/llvm/utils/unittest/CMakeLists.txt index 64446eff41d..b6d2d6d9e0e 100644 --- a/llvm/utils/unittest/CMakeLists.txt +++ b/llvm/utils/unittest/CMakeLists.txt @@ -40,11 +40,9 @@ endif () add_llvm_library(gtest googletest/src/gtest-all.cc - ) -# Depends on llvm::raw_ostream -target_link_libraries(gtest - LLVMSupport + LINK_LIBS + LLVMSupport # Depends on llvm::raw_ostream ) add_subdirectory(UnitTestMain) diff --git a/llvm/utils/unittest/UnitTestMain/CMakeLists.txt b/llvm/utils/unittest/UnitTestMain/CMakeLists.txt index 5f3e6c1ec52..65ef97b0281 100644 --- a/llvm/utils/unittest/UnitTestMain/CMakeLists.txt +++ b/llvm/utils/unittest/UnitTestMain/CMakeLists.txt @@ -1,9 +1,7 @@ add_llvm_library(gtest_main TestMain.cpp - ) -# Depends on llvm::cl -target_link_libraries(gtest_main + LINK_LIBS gtest - LLVMSupport + LLVMSupport # Depends on llvm::cl ) |