Chad Rosier | bf40d6b | 2012-08-09 17:17:01 +0000 | [diff] [blame^] | 1 | set(LLVM_LINK_COMPONENTS |
| 2 | ${LLVM_TARGETS_TO_BUILD} |
| 3 | asmparser |
Peter Collingbourne | 8f5cf74 | 2011-02-19 23:03:58 +0000 | [diff] [blame] | 4 | support |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 5 | mc |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 6 | ) |
| 7 | |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 8 | set(SOURCES |
Argyrios Kyrtzidis | 7fbd97f | 2011-07-09 20:00:58 +0000 | [diff] [blame] | 9 | ARCMigrate.cpp |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 10 | CIndex.cpp |
Ted Kremenek | ae9e221 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 11 | CIndexCXX.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 12 | CIndexCodeCompletion.cpp |
Douglas Gregor | 4f9c376 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 13 | CIndexDiagnostic.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 14 | CIndexDiagnostic.h |
Argyrios Kyrtzidis | cddafd3 | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 15 | CIndexHigh.cpp |
Ted Kremenek | 0b86e3a | 2010-01-26 19:31:51 +0000 | [diff] [blame] | 16 | CIndexInclusionStack.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 17 | CIndexUSRs.cpp |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 18 | CIndexer.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 19 | CIndexer.h |
Dmitri Gribenko | 5e4fe00 | 2012-07-20 21:34:34 +0000 | [diff] [blame] | 20 | CXComment.cpp |
Ted Kremenek | 87553c4 | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 21 | CXCursor.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 22 | CXCursor.h |
Arnaud A. de Grandmaison | 2b3c860 | 2012-06-30 20:43:43 +0000 | [diff] [blame] | 23 | CXCompilationDatabase.cpp |
Ted Kremenek | d010ba4 | 2011-11-10 08:43:12 +0000 | [diff] [blame] | 24 | CXLoadedDiagnostic.cpp |
| 25 | CXLoadedDiagnostic.h |
Ted Kremenek | 4c4f08d | 2011-10-31 22:05:42 +0000 | [diff] [blame] | 26 | CXSourceLocation.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 27 | CXSourceLocation.h |
| 28 | CXStoredDiagnostic.cpp |
Ted Kremenek | 4b4f369 | 2010-11-16 01:56:27 +0000 | [diff] [blame] | 29 | CXString.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 30 | CXString.h |
| 31 | CXTranslationUnit.h |
Ted Kremenek | a594082 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 32 | CXType.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 33 | CXType.h |
Argyrios Kyrtzidis | dc199a3 | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 34 | IndexBody.cpp |
| 35 | IndexDecl.cpp |
| 36 | IndexTypeSourceInfo.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 37 | Index_Internal.h |
Argyrios Kyrtzidis | dc199a3 | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 38 | Indexing.cpp |
| 39 | IndexingContext.cpp |
Ted Kremenek | bb2c710 | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 40 | IndexingContext.h |
Douglas Gregor | 4db3023 | 2010-02-18 04:01:41 +0000 | [diff] [blame] | 41 | ../../include/clang-c/Index.h |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 42 | ) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 43 | |
Chandler Carruth | 28969b4 | 2012-06-21 01:30:21 +0000 | [diff] [blame] | 44 | set(LIBRARIES |
| 45 | clangARCMigrate |
| 46 | clangRewrite |
| 47 | clangFrontend |
| 48 | clangDriver |
| 49 | clangSerialization |
| 50 | clangSema |
| 51 | clangEdit |
| 52 | clangAST |
| 53 | clangLex |
Arnaud A. de Grandmaison | 0fe28a1 | 2012-06-30 11:27:57 +0000 | [diff] [blame] | 54 | clangTooling |
Chandler Carruth | 28969b4 | 2012-06-21 01:30:21 +0000 | [diff] [blame] | 55 | clangBasic |
| 56 | ) |
| 57 | |
NAKAMURA Takumi | a9a35c6 | 2012-07-27 06:17:56 +0000 | [diff] [blame] | 58 | set(GENERATED_HEADERS |
| 59 | ClangAttrClasses |
| 60 | ClangAttrList |
| 61 | ClangAttrParsedAttrList |
| 62 | ClangCommentNodes |
| 63 | ClangDiagnosticCommon |
| 64 | ClangDiagnosticFrontend |
| 65 | ClangDeclNodes |
| 66 | ClangStmtNodes |
| 67 | ) |
| 68 | |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 69 | if( LLVM_ENABLE_PIC ) |
| 70 | set(SHARED_LIBRARY TRUE) |
| 71 | add_clang_library(libclang ${SOURCES}) |
Chandler Carruth | 28969b4 | 2012-06-21 01:30:21 +0000 | [diff] [blame] | 72 | target_link_libraries(libclang ${LIBRARIES}) |
NAKAMURA Takumi | a9a35c6 | 2012-07-27 06:17:56 +0000 | [diff] [blame] | 73 | add_dependencies(libclang ${GENERATED_HEADERS}) |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 74 | |
Manuel Klimek | 4fa6b60 | 2012-05-15 08:58:48 +0000 | [diff] [blame] | 75 | if(WIN32) |
| 76 | set_target_properties(libclang |
| 77 | PROPERTIES |
| 78 | OUTPUT_NAME "libclang" |
| 79 | VERSION ${LIBCLANG_LIBRARY_VERSION} |
| 80 | DEFINE_SYMBOL _CINDEX_LIB_) |
| 81 | else() |
| 82 | set_target_properties(libclang |
| 83 | PROPERTIES |
| 84 | OUTPUT_NAME "clang" |
| 85 | VERSION ${LIBCLANG_LIBRARY_VERSION} |
| 86 | DEFINE_SYMBOL _CINDEX_LIB_) |
| 87 | endif() |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 88 | |
| 89 | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
Oscar Fuentes | a29f7b2 | 2011-03-14 14:32:16 +0000 | [diff] [blame] | 90 | set(LIBCLANG_LINK_FLAGS |
Argyrios Kyrtzidis | 19d09d2 | 2012-04-20 22:07:11 +0000 | [diff] [blame] | 91 | "-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip") |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 92 | set_target_properties(libclang |
| 93 | PROPERTIES |
| 94 | LINK_FLAGS "${LIBCLANG_LINK_FLAGS}" |
| 95 | INSTALL_NAME_DIR "@executable_path/../lib") |
| 96 | endif() |
| 97 | |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 98 | |
| 99 | set(LIBCLANG_STATIC_TARGET_NAME libclang_static) |
| 100 | else() |
| 101 | set(LIBCLANG_STATIC_TARGET_NAME libclang) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 102 | endif() |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 103 | |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 104 | if( NOT BUILD_SHARED_LIBS AND NOT WIN32 ) |
| 105 | add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES}) |
Chandler Carruth | 28969b4 | 2012-06-21 01:30:21 +0000 | [diff] [blame] | 106 | target_link_libraries(${LIBCLANG_STATIC_TARGET_NAME} ${LIBRARIES}) |
NAKAMURA Takumi | a9a35c6 | 2012-07-27 06:17:56 +0000 | [diff] [blame] | 107 | add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS}) |
Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 108 | |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 109 | set_target_properties(${LIBCLANG_STATIC_TARGET_NAME} |
| 110 | PROPERTIES |
Manuel Klimek | 4fa6b60 | 2012-05-15 08:58:48 +0000 | [diff] [blame] | 111 | OUTPUT_NAME "clang") |
Oscar Fuentes | 7221610 | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 112 | endif() |