CMakeLists.txt revision 305c613af6cfc40e519c75d9d2c84c6fa9a841c0
1d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)set(LLVM_LINK_COMPONENTS
2d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  ${LLVM_TARGETS_TO_BUILD}
3d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  asmparser
4d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  support
5d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  mc
6d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  )
7d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
8d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)set(SOURCES
9d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  ARCMigrate.cpp
10d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndex.cpp
11d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexCXX.cpp
12d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexCodeCompletion.cpp
13d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexDiagnostic.cpp
14e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)  CIndexDiagnostic.h
15d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexHigh.cpp
16d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexInclusionStack.cpp
17d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexUSRs.cpp
18d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexer.cpp
19d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CIndexer.h
20d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXComment.cpp
21d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXCursor.cpp
22d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXCursor.h
23d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXCompilationDatabase.cpp
24d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXLoadedDiagnostic.cpp
25d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXLoadedDiagnostic.h
26d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXSourceLocation.cpp
27d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXSourceLocation.h
28d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXStoredDiagnostic.cpp
29d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXString.cpp
30d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXString.h
31d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXTranslationUnit.h
32e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)  CXType.cpp
33d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  CXType.h
34d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  IndexBody.cpp
35d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  IndexDecl.cpp
36d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  IndexTypeSourceInfo.cpp
37d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  Index_Internal.h
38d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  Indexing.cpp
39d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  IndexingContext.cpp
40d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  IndexingContext.h
41d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  ../../include/clang-c/Index.h
42d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)  )
43d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
44d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)set(LIBRARIES
45  clangARCMigrate
46  clangRewriteCore
47  clangRewriteFrontend
48  clangFrontend
49  clangDriver
50  clangSerialization
51  clangSema
52  clangEdit
53  clangAST
54  clangLex
55  clangTooling
56  clangBasic
57  )
58
59set(GENERATED_HEADERS
60  ClangAttrClasses
61  ClangAttrList
62  ClangAttrParsedAttrList
63  ClangCommentNodes
64  ClangDiagnosticCommon
65  ClangDiagnosticFrontend
66  ClangDeclNodes
67  ClangStmtNodes
68  )
69
70if( LLVM_ENABLE_PIC )
71  set(SHARED_LIBRARY TRUE)
72  add_clang_library(libclang ${SOURCES})
73  target_link_libraries(libclang ${LIBRARIES})
74  add_dependencies(libclang ${GENERATED_HEADERS})
75
76  if(WIN32)
77    set_target_properties(libclang
78      PROPERTIES
79      OUTPUT_NAME "libclang"
80      VERSION ${LIBCLANG_LIBRARY_VERSION}
81      DEFINE_SYMBOL _CINDEX_LIB_)
82  else()
83    set_target_properties(libclang
84      PROPERTIES
85      OUTPUT_NAME "clang"
86      VERSION ${LIBCLANG_LIBRARY_VERSION}
87      DEFINE_SYMBOL _CINDEX_LIB_)
88  endif()
89
90  if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
91    set(LIBCLANG_LINK_FLAGS
92      "-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip")
93    set_target_properties(libclang
94      PROPERTIES
95      LINK_FLAGS "${LIBCLANG_LINK_FLAGS}"
96      INSTALL_NAME_DIR "@executable_path/../lib")
97  endif()
98
99
100  set(LIBCLANG_STATIC_TARGET_NAME libclang_static)
101else()
102  set(LIBCLANG_STATIC_TARGET_NAME libclang)
103endif()
104
105if( NOT BUILD_SHARED_LIBS AND NOT WIN32 )
106  add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES})
107  target_link_libraries(${LIBCLANG_STATIC_TARGET_NAME} ${LIBRARIES})
108  add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS})
109
110  set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
111    PROPERTIES
112    OUTPUT_NAME "clang")
113endif()
114