CMake: Builds and installs clang binary and libs (no docs yet). It

must be under the `tools' subdirectory of the LLVM *source* tree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Oscar Fuentes 2008-10-26 00:56:18 +00:00
Родитель 9a30c2474f
Коммит d2f4e5ea6e
13 изменённых файлов: 271 добавлений и 0 удалений

26
CMakeLists.txt Normal file
Просмотреть файл

@ -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.

40
Driver/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)

28
lib/AST/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)

13
lib/Basic/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)

10
lib/CMakeLists.txt Normal file
Просмотреть файл

@ -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)

21
lib/Lex/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)

18
lib/Parse/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)

20
lib/Sema/CMakeLists.txt Normal file
Просмотреть файл

@ -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
)