Michael J. Spencer | 560a921 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 1 | set(LLVM_USED_LIBS |
Argyrios Kyrtzidis | 69325d5 | 2011-07-09 20:00:58 +0000 | [diff] [blame] | 2 | clangARCMigrate |
Argyrios Kyrtzidis | 9621019 | 2011-07-09 21:35:58 +0000 | [diff] [blame] | 3 | clangRewrite |
Michael J. Spencer | 560a921 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 4 | clangFrontend |
| 5 | clangDriver |
| 6 | clangSerialization |
| 7 | clangIndex |
| 8 | clangSema |
| 9 | clangAST |
| 10 | clangLex |
| 11 | clangBasic) |
| 12 | |
| 13 | set( LLVM_LINK_COMPONENTS |
Peter Collingbourne | 4b93d66 | 2011-02-19 23:03:58 +0000 | [diff] [blame] | 14 | support |
Michael J. Spencer | 560a921 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 15 | mc |
Michael J. Spencer | 560a921 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 16 | ) |
| 17 | |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 18 | set(SOURCES |
Argyrios Kyrtzidis | 69325d5 | 2011-07-09 20:00:58 +0000 | [diff] [blame] | 19 | ARCMigrate.cpp |
Ted Kremenek | ab18893 | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 20 | CIndex.cpp |
Ted Kremenek | 3064ef9 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 21 | CIndexCXX.cpp |
Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 22 | CIndexCodeCompletion.cpp |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 23 | CIndexDiagnostic.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 24 | CIndexDiagnostic.h |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 25 | CIndexHigh.cpp |
Ted Kremenek | 16b55a7 | 2010-01-26 19:31:51 +0000 | [diff] [blame] | 26 | CIndexInclusionStack.cpp |
Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 27 | CIndexUSRs.cpp |
Ted Kremenek | ab18893 | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 28 | CIndexer.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 29 | CIndexer.h |
Ted Kremenek | 16c440a | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 30 | CXCursor.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 31 | CXCursor.h |
Ted Kremenek | 1532217 | 2011-11-10 08:43:12 +0000 | [diff] [blame] | 32 | CXLoadedDiagnostic.cpp |
| 33 | CXLoadedDiagnostic.h |
Ted Kremenek | 3ddef06 | 2011-10-31 22:05:42 +0000 | [diff] [blame] | 34 | CXSourceLocation.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 35 | CXSourceLocation.h |
| 36 | CXStoredDiagnostic.cpp |
Ted Kremenek | ed12273 | 2010-11-16 01:56:27 +0000 | [diff] [blame] | 37 | CXString.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 38 | CXString.h |
| 39 | CXTranslationUnit.h |
Ted Kremenek | 95f3355 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 40 | CXType.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 41 | CXType.h |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 42 | IndexBody.cpp |
| 43 | IndexDecl.cpp |
| 44 | IndexTypeSourceInfo.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 45 | Index_Internal.h |
Argyrios Kyrtzidis | 4e7064f | 2011-10-17 19:48:19 +0000 | [diff] [blame] | 46 | Indexing.cpp |
| 47 | IndexingContext.cpp |
Ted Kremenek | 1edabbc | 2011-10-31 21:40:19 +0000 | [diff] [blame] | 48 | IndexingContext.h |
Douglas Gregor | f14bee8 | 2010-02-18 04:01:41 +0000 | [diff] [blame] | 49 | ../../include/clang-c/Index.h |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 50 | ) |
Douglas Gregor | ac47bc7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 51 | |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 52 | if( LLVM_ENABLE_PIC ) |
| 53 | set(SHARED_LIBRARY TRUE) |
| 54 | add_clang_library(libclang ${SOURCES}) |
Douglas Gregor | 73dfa3d | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 55 | |
Daniel Dunbar | f51f20f | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 56 | set_target_properties(libclang |
Douglas Gregor | ac47bc7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 57 | PROPERTIES |
Oscar Fuentes | 4656b63 | 2011-04-10 02:29:27 +0000 | [diff] [blame] | 58 | OUTPUT_NAME "libclang" |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 59 | VERSION ${LIBCLANG_LIBRARY_VERSION} |
| 60 | DEFINE_SYMBOL _CINDEX_LIB_) |
| 61 | |
| 62 | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
Oscar Fuentes | 6656457 | 2011-03-14 14:32:16 +0000 | [diff] [blame] | 63 | set(LIBCLANG_LINK_FLAGS |
| 64 | "-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000") |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 65 | set_target_properties(libclang |
| 66 | PROPERTIES |
| 67 | LINK_FLAGS "${LIBCLANG_LINK_FLAGS}" |
| 68 | INSTALL_NAME_DIR "@executable_path/../lib") |
| 69 | endif() |
| 70 | |
| 71 | if(MSVC) |
| 72 | # windows.h doesn't compile with /Za |
| 73 | get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS) |
| 74 | string(REPLACE "/Za" "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
| 75 | set_target_properties(libclang PROPERTIES |
| 76 | COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
| 77 | endif() |
| 78 | |
| 79 | set(LIBCLANG_STATIC_TARGET_NAME libclang_static) |
| 80 | else() |
| 81 | set(LIBCLANG_STATIC_TARGET_NAME libclang) |
Douglas Gregor | ac47bc7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 82 | endif() |
Douglas Gregor | 2588830 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 83 | |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 84 | if( NOT BUILD_SHARED_LIBS AND NOT WIN32 ) |
| 85 | add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES}) |
Douglas Gregor | 8435bf9 | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 86 | |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 87 | set_target_properties(${LIBCLANG_STATIC_TARGET_NAME} |
| 88 | PROPERTIES |
Oscar Fuentes | 4656b63 | 2011-04-10 02:29:27 +0000 | [diff] [blame] | 89 | OUTPUT_NAME "libclang") |
Oscar Fuentes | 0b34dba | 2011-03-13 15:10:24 +0000 | [diff] [blame] | 90 | endif() |