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 | |
| 5 | set(LLVM_USED_LIBS |
Douglas Gregor | 8775249 | 2010-01-22 20:35:53 +0000 | [diff] [blame] | 6 | clangFrontend |
Daniel Dunbar | 845a87b | 2009-12-02 21:47:55 +0000 | [diff] [blame] | 7 | clangDriver |
| 8 | clangSema |
| 9 | clangAnalysis |
| 10 | clangAST |
| 11 | clangParse |
| 12 | clangLex |
| 13 | clangBasic) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 14 | |
| 15 | set( LLVM_LINK_COMPONENTS |
Daniel Dunbar | 845a87b | 2009-12-02 21:47:55 +0000 | [diff] [blame] | 16 | bitreader |
| 17 | mc |
| 18 | core |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 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 | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 23 | CIndexCodeCompletion.cpp |
Douglas Gregor | 4f9c376 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 24 | CIndexDiagnostic.cpp |
Ted Kremenek | 0b86e3a | 2010-01-26 19:31:51 +0000 | [diff] [blame] | 25 | CIndexInclusionStack.cpp |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 26 | CIndexUSRs.cpp |
Ted Kremenek | 0ec2cca | 2010-01-05 19:32:54 +0000 | [diff] [blame] | 27 | CIndexer.cpp |
Ted Kremenek | 87553c4 | 2010-01-15 20:35:54 +0000 | [diff] [blame] | 28 | CXCursor.cpp |
Douglas Gregor | 4db3023 | 2010-02-18 04:01:41 +0000 | [diff] [blame] | 29 | ../../include/clang-c/Index.h |
Ted Kremenek | 9cd9f6d | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 30 | ) |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame^] | 31 | set_target_properties(libclang PROPERTIES OUTPUT_NAME clang) |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 32 | |
| 33 | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
| 34 | # FIXME: Deal with LLVM_SUBMIT_VERSION? |
| 35 | |
Dan Gohman | 314ca58 | 2010-04-16 04:45:02 +0000 | [diff] [blame] | 36 | # FIXME: This uses a special darwin-specific exports file in order to |
| 37 | # get underscore-prefixed names. It would be better to have build rules |
| 38 | # which know how to produce a darwin-suitable exports file from the |
| 39 | # regular exports file. |
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 |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame^] | 42 | LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/libclang.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000" |
Douglas Gregor | 43bc1a7 | 2009-09-25 06:35:15 +0000 | [diff] [blame] | 43 | INSTALL_NAME_DIR "@executable_path/../lib" |
| 44 | ) |
| 45 | endif() |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 46 | |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 47 | if(MSVC) |
| 48 | # windows.h doesn't compile with /Za |
| 49 | get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS) |
| 50 | string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame^] | 51 | set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) |
Benjamin Kramer | a259086 | 2009-10-18 19:59:44 +0000 | [diff] [blame] | 52 | endif(MSVC) |
| 53 | |
Daniel Dunbar | d5a2a07 | 2010-04-30 21:51:10 +0000 | [diff] [blame^] | 54 | set_target_properties(libclang |
Douglas Gregor | 629f481 | 2009-10-05 22:25:29 +0000 | [diff] [blame] | 55 | PROPERTIES |
Kovarththanan Rajaratnam | a017020 | 2010-03-22 15:44:38 +0000 | [diff] [blame] | 56 | LINKER_LANGUAGE CXX |
| 57 | DEFINE_SYMBOL _CINDEX_LIB_) |