Permalink
Browse files

Remove a goofy CMake hack and use the standard CMake facilities to

express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
1 parent 7d96f61 commit b0d8671f95fe08a220118bca29063ba4d11a9dac @chandlerc chandlerc committed Jun 21, 2012
View
@@ -192,7 +192,6 @@ macro(add_clang_library name)
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
- target_link_libraries( ${name} ${LLVM_USED_LIBS} )
llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
link_system_libs( ${name} )
@@ -1,14 +1,14 @@
set(MODULE TRUE)
-set( LLVM_USED_LIBS
- clangFrontend
- clangAST
- )
-
set( LLVM_LINK_COMPONENTS support mc)
add_clang_library(PrintFunctionNames PrintFunctionNames.cpp)
+target_link_libraries(PrintFunctionNames
+ clangFrontend
+ clangAST
+ )
+
set_target_properties(PrintFunctionNames
PROPERTIES
LINKER_LANGUAGE CXX
@@ -1,13 +1,13 @@
set(MODULE TRUE)
-set( LLVM_USED_LIBS
- clangStaticAnalyzerCore
- )
-
set( LLVM_LINK_COMPONENTS support mc)
add_clang_library(SampleAnalyzerPlugin MainCallChecker.cpp)
+target_link_libraries(SampleAnalyzerPlugin
+ clangStaticAnalyzerCore
+ )
+
set_target_properties(SampleAnalyzerPlugin
PROPERTIES
LINKER_LANGUAGE CXX
@@ -1,34 +1,37 @@
-set(LLVM_USED_LIBS
- clangFrontend
- clangSerialization
- clangDriver
- clangCodeGen
- clangSema
- clangStaticAnalyzerFrontend
- clangStaticAnalyzerCheckers
- clangStaticAnalyzerCore
- clangAnalysis
- clangRewrite
- clangAST
- clangParse
- clangLex
- clangBasic
- )
-
set(LLVM_LINK_COMPONENTS
- jit
- interpreter
- nativecodegen
- asmparser
- bitreader
- bitwriter
- codegen
- ipo
- linker
- selectiondag
+ jit
+ interpreter
+ nativecodegen
+ asmparser
+ bitreader
+ bitwriter
+ codegen
+ ipo
+ linker
+ selectiondag
)
add_clang_executable(clang-interpreter
main.cpp
)
-add_dependencies(clang-interpreter clang-headers)
+
+add_dependencies(clang-interpreter
+ clang-headers
+ )
+
+target_link_libraries(clang-interpreter
+ clangFrontend
+ clangSerialization
+ clangDriver
+ clangCodeGen
+ clangSema
+ clangStaticAnalyzerFrontend
+ clangStaticAnalyzerCheckers
+ clangStaticAnalyzerCore
+ clangAnalysis
+ clangRewrite
+ clangAST
+ clangParse
+ clangLex
+ clangBasic
+ )
@@ -1,5 +1,3 @@
-set(LLVM_USED_LIBS clangBasic clangAST clangParse clangFrontend clangRewrite)
-
add_clang_library(clangARCMigrate
ARCMT.cpp
ARCMTActions.cpp
@@ -27,3 +25,11 @@ add_dependencies(clangARCMigrate
ClangAttrList
ClangDeclNodes
ClangStmtNodes)
+
+target_link_libraries(clangARCMigrate
+ clangBasic
+ clangAST
+ clangParse
+ clangFrontend
+ clangRewrite
+ )
View
@@ -1,7 +1,5 @@
set(LLVM_LINK_COMPONENTS support)
-set(LLVM_USED_LIBS clangBasic clangLex)
-
add_clang_library(clangAST
APValue.cpp
ASTConsumer.cpp
@@ -54,5 +52,17 @@ add_clang_library(clangAST
VTTBuilder.cpp
)
-add_dependencies(clangAST ClangARMNeon ClangAttrClasses ClangAttrList
- ClangAttrImpl ClangDiagnosticAST ClangDeclNodes ClangStmtNodes)
+add_dependencies(clangAST
+ ClangARMNeon
+ ClangAttrClasses
+ ClangAttrList
+ ClangAttrImpl
+ ClangDiagnosticAST
+ ClangDeclNodes
+ ClangStmtNodes
+ )
+
+target_link_libraries(clangAST
+ clangBasic
+ clangLex
+ )
@@ -1,5 +1,3 @@
-set(LLVM_USED_LIBS clangBasic clangAST)
-
add_clang_library(clangAnalysis
AnalysisDeclContext.cpp
CallGraph.cpp
@@ -20,5 +18,15 @@ add_clang_library(clangAnalysis
UninitializedValues.cpp
)
-add_dependencies(clangAnalysis ClangAttrClasses ClangAttrList
- ClangDiagnosticAnalysis ClangDeclNodes ClangStmtNodes)
+add_dependencies(clangAnalysis
+ ClangAttrClasses
+ ClangAttrList
+ ClangDiagnosticAnalysis
+ ClangDeclNodes
+ ClangStmtNodes
+ )
+
+target_link_libraries(clangAnalysis
+ clangBasic
+ clangAST
+ )
View
@@ -32,18 +32,18 @@ if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn")
PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${CLANG_WC_REVISION}\"")
endif()
-add_dependencies(clangBasic
- ClangARMNeon
- ClangAttrList
- ClangDiagnosticAnalysis
- ClangDiagnosticAST
- ClangDiagnosticCommon
- ClangDiagnosticDriver
- ClangDiagnosticFrontend
- ClangDiagnosticGroups
- ClangDiagnosticLex
- ClangDiagnosticParse
- ClangDiagnosticSema
- ClangDiagnosticSerialization
- ClangDiagnosticIndexName)
-
+add_dependencies(clangBasic
+ ClangARMNeon
+ ClangAttrList
+ ClangDiagnosticAnalysis
+ ClangDiagnosticAST
+ ClangDiagnosticCommon
+ ClangDiagnosticDriver
+ ClangDiagnosticFrontend
+ ClangDiagnosticGroups
+ ClangDiagnosticLex
+ ClangDiagnosticParse
+ ClangDiagnosticSema
+ ClangDiagnosticSerialization
+ ClangDiagnosticIndexName
+ )
View
@@ -8,8 +8,6 @@ set(LLVM_LINK_COMPONENTS
vectorize
)
-set(LLVM_USED_LIBS clangBasic clangAST clangFrontend)
-
add_clang_library(clangCodeGen
BackendUtil.cpp
CGBlocks.cpp
@@ -52,5 +50,15 @@ add_clang_library(clangCodeGen
TargetInfo.cpp
)
-add_dependencies(clangCodeGen ClangAttrClasses ClangAttrList ClangDeclNodes
- ClangStmtNodes)
+add_dependencies(clangCodeGen
+ ClangAttrClasses
+ ClangAttrList
+ ClangDeclNodes
+ ClangStmtNodes
+ )
+
+target_link_libraries(clangCodeGen
+ clangBasic
+ clangAST
+ clangFrontend
+ )
View
@@ -1,5 +1,3 @@
-set(LLVM_USED_LIBS clangBasic)
-
add_clang_library(clangDriver
Action.cpp
Arg.cpp
@@ -20,6 +18,13 @@ add_clang_library(clangDriver
Types.cpp
)
+add_dependencies(clangDriver
+ ClangAttrList
+ ClangDiagnosticDriver
+ ClangDriverOptions
+ ClangCC1AsOptions
+ )
-add_dependencies(clangDriver ClangAttrList ClangDiagnosticDriver
- ClangDriverOptions ClangCC1AsOptions)
+target_link_libraries(clangDriver
+ clangBasic
+ )
View
@@ -1,7 +1,11 @@
-set(LLVM_USED_LIBS clangBasic clangAST clangLex)
-
add_clang_library(clangEdit
Commit.cpp
EditedSource.cpp
RewriteObjCFoundationAPI.cpp
)
+
+target_link_libraries(clangEdit
+ clangBasic
+ clangAST
+ clangLex
+ )
@@ -1,14 +1,3 @@
-set( LLVM_USED_LIBS
- clangAST
- clangBasic
- clangDriver
- clangEdit
- clangLex
- clangParse
- clangSema
- clangSerialization
- )
-
add_clang_library(clangFrontend
ASTConsumers.cpp
ASTMerge.cpp
@@ -41,7 +30,6 @@ add_clang_library(clangFrontend
Warnings.cpp
)
-
add_dependencies(clangFrontend
ClangAttrClasses
ClangAttrList
@@ -50,4 +38,16 @@ add_dependencies(clangFrontend
ClangDiagnosticSema
ClangDriverOptions
ClangDeclNodes
- ClangStmtNodes)
+ ClangStmtNodes
+ )
+
+target_link_libraries(clangFrontend
+ clangAST
+ clangBasic
+ clangDriver
+ clangEdit
+ clangLex
+ clangParse
+ clangSema
+ clangSerialization
+ )
@@ -1,10 +1,18 @@
-set(LLVM_USED_LIBS clangDriver clangFrontend clangRewrite clangCodeGen
- clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore
- clangARCMigrate)
-
add_clang_library(clangFrontendTool
ExecuteCompilerInvocation.cpp
)
add_dependencies(clangFrontendTool
- ClangDiagnosticFrontend)
+ ClangDiagnosticFrontend
+ )
+
+target_link_libraries(clangFrontendTool
+ clangDriver
+ clangFrontend
+ clangRewrite
+ clangCodeGen
+ clangStaticAnalyzerFrontend
+ clangStaticAnalyzerCheckers
+ clangStaticAnalyzerCore
+ clangARCMigrate
+ )
View
@@ -2,8 +2,6 @@
set(LLVM_LINK_COMPONENTS support)
-set(LLVM_USED_LIBS clangBasic)
-
add_clang_library(clangLex
HeaderMap.cpp
HeaderSearch.cpp
@@ -28,4 +26,11 @@ add_clang_library(clangLex
TokenLexer.cpp
)
-add_dependencies(clangLex ClangDiagnosticLex ClangAttrSpellings)
+add_dependencies(clangLex
+ ClangDiagnosticLex
+ ClangAttrSpellings
+ )
+
+target_link_libraries(clangLex
+ clangBasic
+ )
View
@@ -1,5 +1,3 @@
-set(LLVM_USED_LIBS clangBasic clangAST clangLex clangSema)
-
add_clang_library(clangParse
ParseAST.cpp
ParseCXXInlineMethods.cpp
@@ -16,4 +14,18 @@ add_clang_library(clangParse
Parser.cpp
)
-add_dependencies(clangParse ClangAttrClasses ClangAttrList ClangDeclNodes ClangDiagnosticParse ClangStmtNodes ClangAttrLateParsed)
+add_dependencies(clangParse
+ ClangAttrClasses
+ ClangAttrList
+ ClangDeclNodes
+ ClangDiagnosticParse
+ ClangStmtNodes
+ ClangAttrLateParsed
+ )
+
+target_link_libraries(clangParse
+ clangBasic
+ clangAST
+ clangLex
+ clangSema
+ )
Oops, something went wrong.

0 comments on commit b0d8671

Please sign in to comment.