2010-09-14 03:54:41 +04:00
|
|
|
set(LLVM_USED_LIBS
|
|
|
|
clangFrontend
|
|
|
|
clangDriver
|
|
|
|
clangSerialization
|
|
|
|
clangIndex
|
|
|
|
clangSema
|
|
|
|
clangAST
|
|
|
|
clangLex
|
|
|
|
clangBasic)
|
|
|
|
|
|
|
|
set( LLVM_LINK_COMPONENTS
|
2011-02-20 02:03:58 +03:00
|
|
|
support
|
2010-09-14 03:54:41 +04:00
|
|
|
mc
|
|
|
|
)
|
|
|
|
|
2011-03-13 18:10:24 +03:00
|
|
|
set(SOURCES
|
2010-01-05 22:32:54 +03:00
|
|
|
CIndex.cpp
|
2010-08-28 01:34:58 +04:00
|
|
|
CIndexCXX.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-11-16 04:56:27 +03:00
|
|
|
CXString.cpp
|
2010-08-26 05:42:22 +04:00
|
|
|
CXType.cpp
|
2010-02-18 07:01:41 +03:00
|
|
|
../../include/clang-c/Index.h
|
2011-03-13 18:10:24 +03:00
|
|
|
)
|
2011-03-13 01:01:58 +03:00
|
|
|
|
2011-03-13 18:10:24 +03:00
|
|
|
if( LLVM_ENABLE_PIC )
|
|
|
|
set(SHARED_LIBRARY TRUE)
|
|
|
|
add_clang_library(libclang ${SOURCES})
|
2011-03-13 01:01:58 +03:00
|
|
|
|
2011-03-13 07:28:29 +03:00
|
|
|
set_target_properties(libclang
|
2011-03-13 01:01:58 +03:00
|
|
|
PROPERTIES
|
2011-03-13 18:10:24 +03:00
|
|
|
OUTPUT_NAME "clang"
|
|
|
|
VERSION ${LIBCLANG_LIBRARY_VERSION}
|
|
|
|
DEFINE_SYMBOL _CINDEX_LIB_)
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2011-03-14 17:32:16 +03:00
|
|
|
set(LIBCLANG_LINK_FLAGS
|
|
|
|
"-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000")
|
2011-03-13 18:10:24 +03:00
|
|
|
set_target_properties(libclang
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "${LIBCLANG_LINK_FLAGS}"
|
|
|
|
INSTALL_NAME_DIR "@executable_path/../lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
# windows.h doesn't compile with /Za
|
|
|
|
get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS)
|
|
|
|
string(REPLACE "/Za" "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
|
|
|
set_target_properties(libclang PROPERTIES
|
|
|
|
COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LIBCLANG_STATIC_TARGET_NAME libclang_static)
|
|
|
|
else()
|
|
|
|
set(LIBCLANG_STATIC_TARGET_NAME libclang)
|
2011-03-13 01:01:58 +03:00
|
|
|
endif()
|
2011-03-13 07:28:29 +03:00
|
|
|
|
2011-03-13 18:10:24 +03:00
|
|
|
if( NOT BUILD_SHARED_LIBS AND NOT WIN32 )
|
|
|
|
add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES})
|
|
|
|
|
|
|
|
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "clang")
|
|
|
|
endif()
|