blob: 26e1b3bb905c7dc3b69f31c77f790744c450fb60 [file] [log] [blame]
Douglas Gregorac47bc72009-09-25 06:35:15 +00001set(SHARED_LIBRARY TRUE)
2
3set(LLVM_NO_RTTI 1)
4
5set(LLVM_USED_LIBS
Douglas Gregora030b7c2010-01-22 20:35:53 +00006 clangFrontend
Daniel Dunbar467f0302009-12-02 21:47:55 +00007 clangDriver
8 clangSema
9 clangAnalysis
10 clangAST
11 clangParse
12 clangLex
13 clangBasic)
Douglas Gregorac47bc72009-09-25 06:35:15 +000014
15set( LLVM_LINK_COMPONENTS
Daniel Dunbar467f0302009-12-02 21:47:55 +000016 bitreader
17 mc
18 core
Douglas Gregorac47bc72009-09-25 06:35:15 +000019 )
20
Ted Kremenekab188932010-01-05 19:32:54 +000021add_clang_library(CIndex
22 CIndex.cpp
Ted Kremenek1b6869a2010-01-05 22:06:45 +000023 CIndexCodeCompletion.cpp
Douglas Gregor5352ac02010-01-28 00:27:43 +000024 CIndexDiagnostic.cpp
Ted Kremenek16b55a72010-01-26 19:31:51 +000025 CIndexInclusionStack.cpp
Ted Kremenek1b6869a2010-01-05 22:06:45 +000026 CIndexUSRs.cpp
Ted Kremenekab188932010-01-05 19:32:54 +000027 CIndexer.cpp
Ted Kremenek16c440a2010-01-15 20:35:54 +000028 CXCursor.cpp
Ted Kremenek1b6869a2010-01-05 22:06:45 +000029)
Douglas Gregorac47bc72009-09-25 06:35:15 +000030
31if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
32 # FIXME: Deal with LLVM_SUBMIT_VERSION?
33
34 set_target_properties(CIndex
35 PROPERTIES
36 LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
37 INSTALL_NAME_DIR "@executable_path/../lib"
38 )
39endif()
Douglas Gregor25888302009-10-05 22:25:29 +000040
Benjamin Kramer63444b32009-10-18 19:59:44 +000041if(MSVC)
42 # windows.h doesn't compile with /Za
43 get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
44 string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
John Thompson2e06fc82009-10-27 13:42:56 +000045 set(NON_ANSI_COMPILE_FLAGS "${NON_ANSI_COMPILE_FLAGS} /D_CINDEX_LIB_")
Benjamin Kramer63444b32009-10-18 19:59:44 +000046 set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
47endif(MSVC)
48
Douglas Gregor25888302009-10-05 22:25:29 +000049set_target_properties(CIndex
50 PROPERTIES
51 LINKER_LANGUAGE CXX)