Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 1 | set(SHARED_LIBRARY TRUE) |
| 2 | |
| 3 | set(LLVM_NO_RTTI 1) |
| 4 | |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 5 | set(LLVM_USED_LIBS |
| 6 | clangFrontend |
| 7 | clangDriver |
| 8 | clangSerialization |
| 9 | clangIndex |
| 10 | clangSema |
| 11 | clangAST |
| 12 | clangLex |
| 13 | clangBasic) |
| 14 | |
| 15 | set( LLVM_LINK_COMPONENTS |
| 16 | bitreader |
| 17 | mc |
| 18 | core |
| 19 | ) |
| 20 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 21 | add_clang_library(libclang |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 22 | CIndex.cpp |
Ted Kremenek | ae9e221 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 23 | CIndexCXX.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 24 | CIndexCodeCompletion.cpp |
Douglas Gregor | 4f9c376 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 25 | CIndexDiagnostic.cpp |
Ted Kremenek | 0b86e3a | 2010-01-26 19:31:51 +0000 | [diff] [blame] | 26 | CIndexInclusionStack.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 27 | CIndexUSRs.cpp |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 28 | CIndexer.cpp |
Ted Kremenek | 87553c4 | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 29 | CXCursor.cpp |
Ted Kremenek | 4b4f369 | 2010-11-16 01:56:27 +0000 | [diff] [blame^] | 30 | CXString.cpp |
Ted Kremenek | a594082 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 31 | CXType.cpp |
Douglas Gregor | 4db3023 | 2010-02-18 04:01:41 +0000 | [diff] [blame] | 32 | ../../include/clang-c/Index.h |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 33 | ) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 34 | |
| 35 | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 36 | # dylib versioning information |
| 37 | # FIXME: Is there a more CMake-ish way to handle this? |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 38 | set(LIBCLANG_VERSION 1 |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 39 | CACHE STRING "Version number of the libclang library") |
| 40 | set(LIBCLANG_SUBVERSION 0 |
| 41 | CACHE STRING "Minor version number of the libclang library") |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 42 | set(LIBCLANG_LINK_FLAGS |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 43 | "-Wl,-current_version -Wl,${LIBCLANG_VERSION}.${LIBCLANG_SUBVERSION} -Wl,-compatibility_version -Wl,1") |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 44 | |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 45 | set(LIBCLANG_LINK_FLAGS |
Douglas Gregor | efcc6da | 2010-08-06 11:08:45 +0000 | [diff] [blame] | 46 | "${LIBCLANG_LINK_FLAGS} -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000") |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 47 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 48 | set_target_properties(libclang |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 49 | PROPERTIES |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 50 | LINK_FLAGS "${LIBCLANG_LINK_FLAGS}" |
| 51 | INSTALL_NAME_DIR "@executable_path/../lib") |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 52 | endif() |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 53 | |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 54 | if(MSVC) |
| 55 | # windows.h doesn't compile with /Za |
Daniel Dunbar | 832fc4a | 2010-05-01 00:06:42 +0000 | [diff] [blame] | 56 | get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS) |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 57 | string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 58 | set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 59 | endif(MSVC) |
| 60 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 61 | set_target_properties(libclang |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 62 | PROPERTIES |
Kovarththanan Rajaratnam | a017020 | 2010-03-22 15:44:38 +0000 | [diff] [blame] | 63 | LINKER_LANGUAGE CXX |
| 64 | DEFINE_SYMBOL _CINDEX_LIB_) |