2009-09-25 10:35:15 +04:00
|
|
|
set(SHARED_LIBRARY TRUE)
|
|
|
|
|
|
|
|
set(LLVM_NO_RTTI 1)
|
|
|
|
|
|
|
|
set(LLVM_USED_LIBS
|
2010-01-22 23:35:53 +03:00
|
|
|
clangFrontend
|
2009-12-03 00:47:55 +03:00
|
|
|
clangDriver
|
|
|
|
clangSema
|
|
|
|
clangAnalysis
|
|
|
|
clangAST
|
|
|
|
clangParse
|
|
|
|
clangLex
|
|
|
|
clangBasic)
|
2009-09-25 10:35:15 +04:00
|
|
|
|
|
|
|
set( LLVM_LINK_COMPONENTS
|
2009-12-03 00:47:55 +03:00
|
|
|
bitreader
|
|
|
|
mc
|
|
|
|
core
|
2009-09-25 10:35:15 +04:00
|
|
|
)
|
|
|
|
|
2010-05-01 01:51:10 +04:00
|
|
|
add_clang_library(libclang
|
2010-01-05 22:32:54 +03:00
|
|
|
CIndex.cpp
|
2010-01-06 01:06:45 +03:00
|
|
|
CIndexCodeCompletion.cpp
|
2010-01-28 03:27:43 +03:00
|
|
|
CIndexDiagnostic.cpp
|
2010-01-26 22:31:51 +03:00
|
|
|
CIndexInclusionStack.cpp
|
2010-01-06 01:06:45 +03:00
|
|
|
CIndexUSRs.cpp
|
2010-01-05 22:32:54 +03:00
|
|
|
CIndexer.cpp
|
2010-01-15 23:35:54 +03:00
|
|
|
CXCursor.cpp
|
2010-02-18 07:01:41 +03:00
|
|
|
../../include/clang-c/Index.h
|
2010-01-06 01:06:45 +03:00
|
|
|
)
|
2010-05-01 01:51:10 +04:00
|
|
|
set_target_properties(libclang PROPERTIES OUTPUT_NAME clang)
|
2009-09-25 10:35:15 +04:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
# FIXME: Deal with LLVM_SUBMIT_VERSION?
|
|
|
|
|
2010-04-16 08:45:02 +04:00
|
|
|
# FIXME: This uses a special darwin-specific exports file in order to
|
|
|
|
# get underscore-prefixed names. It would be better to have build rules
|
|
|
|
# which know how to produce a darwin-suitable exports file from the
|
|
|
|
# regular exports file.
|
2010-05-01 01:51:10 +04:00
|
|
|
set_target_properties(libclang
|
2009-09-25 10:35:15 +04:00
|
|
|
PROPERTIES
|
2010-05-01 01:51:10 +04:00
|
|
|
LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/libclang.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
|
2009-09-25 10:35:15 +04:00
|
|
|
INSTALL_NAME_DIR "@executable_path/../lib"
|
|
|
|
)
|
|
|
|
endif()
|
2009-10-06 02:25:29 +04:00
|
|
|
|
2009-10-18 23:59:44 +04:00
|
|
|
if(MSVC)
|
|
|
|
# windows.h doesn't compile with /Za
|
2010-05-01 04:06:42 +04:00
|
|
|
get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS)
|
2009-10-18 23:59:44 +04:00
|
|
|
string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
2010-05-01 01:51:10 +04:00
|
|
|
set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
2009-10-18 23:59:44 +04:00
|
|
|
endif(MSVC)
|
|
|
|
|
2010-05-01 01:51:10 +04:00
|
|
|
set_target_properties(libclang
|
2009-10-06 02:25:29 +04:00
|
|
|
PROPERTIES
|
2010-03-22 18:44:38 +03:00
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
DEFINE_SYMBOL _CINDEX_LIB_)
|