blob: 6aa7a579839f791fba9086c1d404399f95214e4a [file] [log] [blame]
Douglas Gregor43bc1a72009-09-25 06:35:15 +00001set(SHARED_LIBRARY TRUE)
2
3set(LLVM_NO_RTTI 1)
4
5set(LLVM_USED_LIBS
Douglas Gregor87752492010-01-22 20:35:53 +00006 clangFrontend
Daniel Dunbar845a87b2009-12-02 21:47:55 +00007 clangDriver
8 clangSema
9 clangAnalysis
10 clangAST
11 clangParse
12 clangLex
13 clangBasic)
Douglas Gregor43bc1a72009-09-25 06:35:15 +000014
15set( LLVM_LINK_COMPONENTS
Daniel Dunbar845a87b2009-12-02 21:47:55 +000016 bitreader
17 mc
18 core
Douglas Gregor43bc1a72009-09-25 06:35:15 +000019 )
20
Ted Kremenek0ec2cca2010-01-05 19:32:54 +000021add_clang_library(CIndex
22 CIndex.cpp
Ted Kremenek9cd9f6d2010-01-05 22:06:45 +000023 CIndexCodeCompletion.cpp
Douglas Gregor4f9c3762010-01-28 00:27:43 +000024 CIndexDiagnostic.cpp
Ted Kremenek0b86e3a2010-01-26 19:31:51 +000025 CIndexInclusionStack.cpp
Ted Kremenek9cd9f6d2010-01-05 22:06:45 +000026 CIndexUSRs.cpp
Ted Kremenek0ec2cca2010-01-05 19:32:54 +000027 CIndexer.cpp
Ted Kremenek87553c42010-01-15 20:35:54 +000028 CXCursor.cpp
Douglas Gregor4db30232010-02-18 04:01:41 +000029 ../../include/clang-c/Index.h
Ted Kremenek9cd9f6d2010-01-05 22:06:45 +000030)
Douglas Gregor43bc1a72009-09-25 06:35:15 +000031
32if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
33 # FIXME: Deal with LLVM_SUBMIT_VERSION?
34
35 set_target_properties(CIndex
36 PROPERTIES
37 LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
38 INSTALL_NAME_DIR "@executable_path/../lib"
39 )
40endif()
Douglas Gregor629f4812009-10-05 22:25:29 +000041
Benjamin Kramera2590862009-10-18 19:59:44 +000042if(MSVC)
43 # windows.h doesn't compile with /Za
44 get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
45 string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
46 set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
47endif(MSVC)
48
Douglas Gregor629f4812009-10-05 22:25:29 +000049set_target_properties(CIndex
50 PROPERTIES
Kovarththanan Rajaratnama0170202010-03-22 15:44:38 +000051 LINKER_LANGUAGE CXX
52 DEFINE_SYMBOL _CINDEX_LIB_)