Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 1 | set(SHARED_LIBRARY TRUE) |
| 2 | |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 3 | set(LLVM_USED_LIBS |
| 4 | clangFrontend |
| 5 | clangDriver |
| 6 | clangSerialization |
| 7 | clangIndex |
| 8 | clangSema |
| 9 | clangAST |
| 10 | clangLex |
| 11 | clangBasic) |
| 12 | |
| 13 | set( LLVM_LINK_COMPONENTS |
Peter Collingbourne | 8f5cf74 | 2011-02-19 23:03:58 +0000 | [diff] [blame] | 14 | support |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 15 | mc |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 16 | ) |
| 17 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 18 | add_clang_library(libclang |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 19 | CIndex.cpp |
Ted Kremenek | ae9e221 | 2010-08-27 21:34:58 +0000 | [diff] [blame] | 20 | CIndexCXX.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 21 | CIndexCodeCompletion.cpp |
Douglas Gregor | 4f9c376 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 22 | CIndexDiagnostic.cpp |
Ted Kremenek | 0b86e3a | 2010-01-26 19:31:51 +0000 | [diff] [blame] | 23 | CIndexInclusionStack.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 24 | CIndexUSRs.cpp |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 25 | CIndexer.cpp |
Ted Kremenek | 87553c4 | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 26 | CXCursor.cpp |
Ted Kremenek | 4b4f369 | 2010-11-16 01:56:27 +0000 | [diff] [blame] | 27 | CXString.cpp |
Ted Kremenek | a594082 | 2010-08-26 01:42:22 +0000 | [diff] [blame] | 28 | CXType.cpp |
Douglas Gregor | 4db3023 | 2010-02-18 04:01:41 +0000 | [diff] [blame] | 29 | ../../include/clang-c/Index.h |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 30 | ) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 31 | |
| 32 | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame^] | 33 | # Darwin-specific linker flags |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 34 | |
Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame^] | 35 | set(LIBCLANG_LINK_FLAGS "-Wl,-compatibility_version -Wl,1") |
| 36 | |
Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 37 | set(LIBCLANG_LINK_FLAGS |
Douglas Gregor | efcc6da | 2010-08-06 11:08:45 +0000 | [diff] [blame] | 38 | "${LIBCLANG_LINK_FLAGS} -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000") |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 39 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 40 | set_target_properties(libclang |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 41 | PROPERTIES |
Douglas Gregor | b1cf1ca | 2010-08-02 20:52:32 +0000 | [diff] [blame] | 42 | LINK_FLAGS "${LIBCLANG_LINK_FLAGS}" |
| 43 | INSTALL_NAME_DIR "@executable_path/../lib") |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 44 | endif() |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 45 | |
Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame^] | 46 | # Versioning information |
| 47 | set_target_properties(libclang PROPERTIES VERSION ${LIBCLANG_LIBRARY_VERSION}) |
| 48 | |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 49 | if(MSVC) |
| 50 | # windows.h doesn't compile with /Za |
Daniel Dunbar | 832fc4a | 2010-05-01 00:06:42 +0000 | [diff] [blame] | 51 | get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS) |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 52 | string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 53 | set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 54 | endif(MSVC) |
| 55 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 56 | set_target_properties(libclang |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 57 | PROPERTIES |
Oscar Fuentes | c9fe3b9 | 2011-02-05 20:00:13 +0000 | [diff] [blame] | 58 | PREFIX "" # Otherwise we get liblibclang.so |
Kovarththanan Rajaratnam | a017020 | 2010-03-22 15:44:38 +0000 | [diff] [blame] | 59 | LINKER_LANGUAGE CXX |
| 60 | DEFINE_SYMBOL _CINDEX_LIB_) |