forked from OSchip/llvm-project
CMake: Builds and installs clang binary and libs (no docs yet). It
must be under the `tools' subdirectory of the LLVM *source* tree. llvm-svn: 58180
This commit is contained in:
parent
e638f5d854
commit
07d9f9a6ec
|
@ -0,0 +1,26 @@
|
||||||
|
macro(add_clang_library name)
|
||||||
|
add_library( ${name} ${ARGN} )
|
||||||
|
if( LLVM_COMMON_DEPENDS )
|
||||||
|
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
|
||||||
|
endif( LLVM_COMMON_DEPENDS )
|
||||||
|
install(TARGETS ${name}
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endmacro(add_clang_library)
|
||||||
|
|
||||||
|
macro(add_clang_executable name)
|
||||||
|
add_llvm_executable( ${name} ${ARGN} )
|
||||||
|
install(TARGETS ${name}
|
||||||
|
RUNTIME DESTINATION bin)
|
||||||
|
endmacro(add_clang_executable)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
add_definitions( -D_GNU_SOURCE )
|
||||||
|
|
||||||
|
add_subdirectory(lib)
|
||||||
|
add_subdirectory(Driver)
|
||||||
|
|
||||||
|
# TODO: docs.
|
|
@ -0,0 +1,40 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
set( LLVM_USED_LIBS
|
||||||
|
clangCodeGen
|
||||||
|
clangAnalysis
|
||||||
|
clangRewrite
|
||||||
|
clangSema
|
||||||
|
clangDriver
|
||||||
|
clangAST
|
||||||
|
clangParse
|
||||||
|
clangLex
|
||||||
|
clangBasic
|
||||||
|
)
|
||||||
|
|
||||||
|
set( LLVM_LINK_COMPONENTS
|
||||||
|
${LLVM_TARGETS_TO_BUILD}
|
||||||
|
bitreader
|
||||||
|
bitwriter
|
||||||
|
codegen
|
||||||
|
ipo
|
||||||
|
selectiondag
|
||||||
|
)
|
||||||
|
|
||||||
|
add_clang_executable(clang
|
||||||
|
AnalysisConsumer.cpp
|
||||||
|
ASTConsumers.cpp
|
||||||
|
Backend.cpp
|
||||||
|
CacheTokens.cpp
|
||||||
|
clang.cpp
|
||||||
|
DependencyFile.cpp
|
||||||
|
DiagChecker.cpp
|
||||||
|
HTMLPrint.cpp
|
||||||
|
PrintParserCallbacks.cpp
|
||||||
|
PrintPreprocessedOutput.cpp
|
||||||
|
RewriteBlocks.cpp
|
||||||
|
RewriteMacros.cpp
|
||||||
|
RewriteObjC.cpp
|
||||||
|
RewriteTest.cpp
|
||||||
|
SerializationTest.cpp
|
||||||
|
)
|
|
@ -0,0 +1,28 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangAST
|
||||||
|
ASTConsumer.cpp
|
||||||
|
ASTContext.cpp
|
||||||
|
Builtins.cpp
|
||||||
|
CFG.cpp
|
||||||
|
DeclBase.cpp
|
||||||
|
Decl.cpp
|
||||||
|
DeclCXX.cpp
|
||||||
|
DeclGroup.cpp
|
||||||
|
DeclObjC.cpp
|
||||||
|
DeclSerialization.cpp
|
||||||
|
ExprConstant.cpp
|
||||||
|
Expr.cpp
|
||||||
|
ExprCXX.cpp
|
||||||
|
InheritViz.cpp
|
||||||
|
ParentMap.cpp
|
||||||
|
Stmt.cpp
|
||||||
|
StmtDumper.cpp
|
||||||
|
StmtIterator.cpp
|
||||||
|
StmtPrinter.cpp
|
||||||
|
StmtSerialization.cpp
|
||||||
|
StmtViz.cpp
|
||||||
|
TranslationUnit.cpp
|
||||||
|
Type.cpp
|
||||||
|
TypeSerialization.cpp
|
||||||
|
)
|
|
@ -0,0 +1,31 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangAnalysis
|
||||||
|
BasicConstraintManager.cpp
|
||||||
|
BasicObjCFoundationChecks.cpp
|
||||||
|
BasicStore.cpp
|
||||||
|
BasicValueFactory.cpp
|
||||||
|
BugReporter.cpp
|
||||||
|
CFRefCount.cpp
|
||||||
|
CheckDeadStores.cpp
|
||||||
|
CheckNSError.cpp
|
||||||
|
CheckObjCDealloc.cpp
|
||||||
|
CheckObjCInstMethSignature.cpp
|
||||||
|
CheckObjCUnusedIVars.cpp
|
||||||
|
Environment.cpp
|
||||||
|
ExplodedGraph.cpp
|
||||||
|
GRBlockCounter.cpp
|
||||||
|
GRCoreEngine.cpp
|
||||||
|
GRExprEngine.cpp
|
||||||
|
GRExprEngineInternalChecks.cpp
|
||||||
|
GRSimpleVals.cpp
|
||||||
|
GRState.cpp
|
||||||
|
GRTransferFuncs.cpp
|
||||||
|
LiveVariables.cpp
|
||||||
|
MemRegion.cpp
|
||||||
|
PathDiagnostic.cpp
|
||||||
|
RegionStore.cpp
|
||||||
|
SVals.cpp
|
||||||
|
SymbolManager.cpp
|
||||||
|
UninitializedValues.cpp
|
||||||
|
)
|
|
@ -0,0 +1,13 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangBasic
|
||||||
|
Diagnostic.cpp
|
||||||
|
FileManager.cpp
|
||||||
|
IdentifierTable.cpp
|
||||||
|
LangOptions.cpp
|
||||||
|
SourceLocation.cpp
|
||||||
|
SourceManager.cpp
|
||||||
|
TargetInfo.cpp
|
||||||
|
Targets.cpp
|
||||||
|
TokenKinds.cpp
|
||||||
|
)
|
|
@ -0,0 +1,10 @@
|
||||||
|
add_subdirectory(Headers)
|
||||||
|
add_subdirectory(Basic)
|
||||||
|
add_subdirectory(Lex)
|
||||||
|
add_subdirectory(Parse)
|
||||||
|
add_subdirectory(AST)
|
||||||
|
add_subdirectory(Sema)
|
||||||
|
add_subdirectory(CodeGen)
|
||||||
|
add_subdirectory(Analysis)
|
||||||
|
add_subdirectory(Rewrite)
|
||||||
|
add_subdirectory(Driver)
|
|
@ -0,0 +1,22 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangCodeGen
|
||||||
|
CGBuiltin.cpp
|
||||||
|
CGCall.cpp
|
||||||
|
CGCXX.cpp
|
||||||
|
CGDebugInfo.cpp
|
||||||
|
CGDecl.cpp
|
||||||
|
CGExprAgg.cpp
|
||||||
|
CGExprComplex.cpp
|
||||||
|
CGExprConstant.cpp
|
||||||
|
CGExpr.cpp
|
||||||
|
CGExprScalar.cpp
|
||||||
|
CGObjC.cpp
|
||||||
|
CGObjCGNU.cpp
|
||||||
|
CGObjCMac.cpp
|
||||||
|
CGStmt.cpp
|
||||||
|
CodeGenFunction.cpp
|
||||||
|
CodeGenModule.cpp
|
||||||
|
CodeGenTypes.cpp
|
||||||
|
ModuleBuilder.cpp
|
||||||
|
)
|
|
@ -0,0 +1,8 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangDriver
|
||||||
|
HTMLDiagnostics.cpp
|
||||||
|
InitHeaderSearch.cpp
|
||||||
|
TextDiagnosticBuffer.cpp
|
||||||
|
TextDiagnosticPrinter.cpp
|
||||||
|
)
|
|
@ -0,0 +1,25 @@
|
||||||
|
set(files
|
||||||
|
iso646.h
|
||||||
|
mmintrin.h
|
||||||
|
stdarg.h
|
||||||
|
stdbool.h
|
||||||
|
stddef.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(output_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../Headers)
|
||||||
|
|
||||||
|
foreach( f ${files} )
|
||||||
|
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
|
||||||
|
set( dst ${output_dir}/${f} )
|
||||||
|
add_custom_command(OUTPUT ${dst}
|
||||||
|
DEPENDS ${src}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
|
||||||
|
COMMENT "Copying clang's ${f}...")
|
||||||
|
endforeach( f )
|
||||||
|
|
||||||
|
add_custom_target(clang_headers ALL
|
||||||
|
DEPENDS ${files})
|
||||||
|
|
||||||
|
install(FILES ${files}
|
||||||
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
|
DESTINATION Headers)
|
|
@ -0,0 +1,21 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
# TODO: Add -maltivec when ARCH is PowerPC.
|
||||||
|
|
||||||
|
add_clang_library(clangLex
|
||||||
|
HeaderMap.cpp
|
||||||
|
HeaderSearch.cpp
|
||||||
|
Lexer.cpp
|
||||||
|
LiteralSupport.cpp
|
||||||
|
MacroArgs.cpp
|
||||||
|
MacroInfo.cpp
|
||||||
|
PPCaching.cpp
|
||||||
|
PPDirectives.cpp
|
||||||
|
PPExpressions.cpp
|
||||||
|
PPLexerChange.cpp
|
||||||
|
PPMacroExpansion.cpp
|
||||||
|
Pragma.cpp
|
||||||
|
Preprocessor.cpp
|
||||||
|
ScratchBuffer.cpp
|
||||||
|
TokenLexer.cpp
|
||||||
|
)
|
|
@ -0,0 +1,18 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangParse
|
||||||
|
AttributeList.cpp
|
||||||
|
DeclSpec.cpp
|
||||||
|
MinimalAction.cpp
|
||||||
|
ParseCXXInlineMethods.cpp
|
||||||
|
ParseDecl.cpp
|
||||||
|
ParseDeclCXX.cpp
|
||||||
|
ParseExpr.cpp
|
||||||
|
ParseExprCXX.cpp
|
||||||
|
ParseInit.cpp
|
||||||
|
ParseObjc.cpp
|
||||||
|
ParsePragma.cpp
|
||||||
|
Parser.cpp
|
||||||
|
ParseStmt.cpp
|
||||||
|
ParseTentative.cpp
|
||||||
|
)
|
|
@ -0,0 +1,9 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangRewrite
|
||||||
|
DeltaTree.cpp
|
||||||
|
HTMLRewrite.cpp
|
||||||
|
Rewriter.cpp
|
||||||
|
RewriteRope.cpp
|
||||||
|
TokenRewriter.cpp
|
||||||
|
)
|
|
@ -0,0 +1,20 @@
|
||||||
|
set(LLVM_NO_RTTI 1)
|
||||||
|
|
||||||
|
add_clang_library(clangSema
|
||||||
|
IdentifierResolver.cpp
|
||||||
|
ParseAST.cpp
|
||||||
|
SemaChecking.cpp
|
||||||
|
Sema.cpp
|
||||||
|
SemaDeclAttr.cpp
|
||||||
|
SemaDecl.cpp
|
||||||
|
SemaDeclCXX.cpp
|
||||||
|
SemaDeclObjC.cpp
|
||||||
|
SemaExpr.cpp
|
||||||
|
SemaExprCXX.cpp
|
||||||
|
SemaExprObjC.cpp
|
||||||
|
SemaInherit.cpp
|
||||||
|
SemaInit.cpp
|
||||||
|
SemaOverload.cpp
|
||||||
|
SemaStmt.cpp
|
||||||
|
SemaType.cpp
|
||||||
|
)
|
Loading…
Reference in New Issue