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