summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt26
-rw-r--r--Driver/CMakeLists.txt40
-rw-r--r--lib/AST/CMakeLists.txt28
-rw-r--r--lib/Analysis/CMakeLists.txt31
-rw-r--r--lib/Basic/CMakeLists.txt13
-rw-r--r--lib/CMakeLists.txt10
-rw-r--r--lib/CodeGen/CMakeLists.txt22
-rw-r--r--lib/Driver/CMakeLists.txt8
-rw-r--r--lib/Headers/CMakeLists.txt25
-rw-r--r--lib/Lex/CMakeLists.txt21
-rw-r--r--lib/Parse/CMakeLists.txt18
-rw-r--r--lib/Rewrite/CMakeLists.txt9
-rw-r--r--lib/Sema/CMakeLists.txt20
13 files changed, 271 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..ccc1158376
--- /dev/null
+++ b/CMakeLists.txt
@@ -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.
diff --git a/Driver/CMakeLists.txt b/Driver/CMakeLists.txt
new file mode 100644
index 0000000000..f0d8ae7d83
--- /dev/null
+++ b/Driver/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt
new file mode 100644
index 0000000000..a58b3b162f
--- /dev/null
+++ b/lib/AST/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt
new file mode 100644
index 0000000000..626087aebf
--- /dev/null
+++ b/lib/Analysis/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt
new file mode 100644
index 0000000000..37fa210df8
--- /dev/null
+++ b/lib/Basic/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644
index 0000000000..d2fafb3927
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -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)
diff --git a/lib/CodeGen/CMakeLists.txt b/lib/CodeGen/CMakeLists.txt
new file mode 100644
index 0000000000..c59853a1b7
--- /dev/null
+++ b/lib/CodeGen/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/Driver/CMakeLists.txt b/lib/Driver/CMakeLists.txt
new file mode 100644
index 0000000000..0caa90cbb4
--- /dev/null
+++ b/lib/Driver/CMakeLists.txt
@@ -0,0 +1,8 @@
+set(LLVM_NO_RTTI 1)
+
+add_clang_library(clangDriver
+ HTMLDiagnostics.cpp
+ InitHeaderSearch.cpp
+ TextDiagnosticBuffer.cpp
+ TextDiagnosticPrinter.cpp
+ )
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
new file mode 100644
index 0000000000..3c42167e5a
--- /dev/null
+++ b/lib/Headers/CMakeLists.txt
@@ -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)
diff --git a/lib/Lex/CMakeLists.txt b/lib/Lex/CMakeLists.txt
new file mode 100644
index 0000000000..684867d87d
--- /dev/null
+++ b/lib/Lex/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/Parse/CMakeLists.txt b/lib/Parse/CMakeLists.txt
new file mode 100644
index 0000000000..1682bcdd16
--- /dev/null
+++ b/lib/Parse/CMakeLists.txt
@@ -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
+ )
diff --git a/lib/Rewrite/CMakeLists.txt b/lib/Rewrite/CMakeLists.txt
new file mode 100644
index 0000000000..52670b82a2
--- /dev/null
+++ b/lib/Rewrite/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(LLVM_NO_RTTI 1)
+
+add_clang_library(clangRewrite
+ DeltaTree.cpp
+ HTMLRewrite.cpp
+ Rewriter.cpp
+ RewriteRope.cpp
+ TokenRewriter.cpp
+ )
diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt
new file mode 100644
index 0000000000..2d8e3c8c3b
--- /dev/null
+++ b/lib/Sema/CMakeLists.txt
@@ -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
+ )