2012-08-10 01:17:01 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
${LLVM_TARGETS_TO_BUILD}
|
|
|
|
asmparser
|
2011-02-20 07:03:58 +08:00
|
|
|
support
|
2013-01-20 02:24:13 +08:00
|
|
|
bitreader
|
2010-09-14 07:54:41 +08:00
|
|
|
mc
|
|
|
|
)
|
|
|
|
|
2011-03-13 23:10:24 +08:00
|
|
|
set(SOURCES
|
2011-07-10 04:00:58 +08:00
|
|
|
ARCMigrate.cpp
|
2010-01-06 03:32:54 +08:00
|
|
|
CIndex.cpp
|
2010-08-28 05:34:58 +08:00
|
|
|
CIndexCXX.cpp
|
2010-01-06 06:06:45 +08:00
|
|
|
CIndexCodeCompletion.cpp
|
2010-01-28 08:27:43 +08:00
|
|
|
CIndexDiagnostic.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CIndexDiagnostic.h
|
2011-10-06 15:00:54 +08:00
|
|
|
CIndexHigh.cpp
|
2010-01-27 03:31:51 +08:00
|
|
|
CIndexInclusionStack.cpp
|
2010-01-06 06:06:45 +08:00
|
|
|
CIndexUSRs.cpp
|
2010-01-06 03:32:54 +08:00
|
|
|
CIndexer.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CIndexer.h
|
2012-07-21 05:34:34 +08:00
|
|
|
CXComment.cpp
|
2010-01-16 04:35:54 +08:00
|
|
|
CXCursor.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CXCursor.h
|
2012-07-01 04:43:43 +08:00
|
|
|
CXCompilationDatabase.cpp
|
2011-11-10 16:43:12 +08:00
|
|
|
CXLoadedDiagnostic.cpp
|
|
|
|
CXLoadedDiagnostic.h
|
2011-11-01 06:05:42 +08:00
|
|
|
CXSourceLocation.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CXSourceLocation.h
|
|
|
|
CXStoredDiagnostic.cpp
|
2010-11-16 09:56:27 +08:00
|
|
|
CXString.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CXString.h
|
|
|
|
CXTranslationUnit.h
|
2010-08-26 09:42:22 +08:00
|
|
|
CXType.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CXType.h
|
2011-10-18 03:48:19 +08:00
|
|
|
IndexBody.cpp
|
|
|
|
IndexDecl.cpp
|
|
|
|
IndexTypeSourceInfo.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
Index_Internal.h
|
2011-10-18 03:48:19 +08:00
|
|
|
Indexing.cpp
|
|
|
|
IndexingContext.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
IndexingContext.h
|
2012-12-19 07:02:59 +08:00
|
|
|
SimpleFormatContext.h
|
2010-02-18 12:01:41 +08:00
|
|
|
../../include/clang-c/Index.h
|
2011-03-13 23:10:24 +08:00
|
|
|
)
|
2011-03-13 06:01:58 +08:00
|
|
|
|
2012-06-21 09:30:21 +08:00
|
|
|
set(LIBRARIES
|
|
|
|
clangARCMigrate
|
2012-09-01 13:09:24 +08:00
|
|
|
clangRewriteCore
|
|
|
|
clangRewriteFrontend
|
2012-06-21 09:30:21 +08:00
|
|
|
clangFrontend
|
|
|
|
clangDriver
|
|
|
|
clangSerialization
|
|
|
|
clangSema
|
|
|
|
clangEdit
|
|
|
|
clangAST
|
|
|
|
clangLex
|
2012-06-30 19:27:57 +08:00
|
|
|
clangTooling
|
2012-06-21 09:30:21 +08:00
|
|
|
clangBasic
|
2012-12-19 07:02:59 +08:00
|
|
|
clangFormat
|
2012-06-21 09:30:21 +08:00
|
|
|
)
|
|
|
|
|
2012-07-27 14:17:56 +08:00
|
|
|
set(GENERATED_HEADERS
|
|
|
|
ClangAttrClasses
|
|
|
|
ClangAttrList
|
|
|
|
ClangAttrParsedAttrList
|
|
|
|
ClangCommentNodes
|
|
|
|
ClangDiagnosticCommon
|
|
|
|
ClangDiagnosticFrontend
|
|
|
|
ClangDeclNodes
|
|
|
|
ClangStmtNodes
|
|
|
|
)
|
|
|
|
|
2011-03-13 23:10:24 +08:00
|
|
|
if( LLVM_ENABLE_PIC )
|
|
|
|
set(SHARED_LIBRARY TRUE)
|
|
|
|
add_clang_library(libclang ${SOURCES})
|
2012-06-21 09:30:21 +08:00
|
|
|
target_link_libraries(libclang ${LIBRARIES})
|
2013-03-30 05:51:40 +08:00
|
|
|
add_dependencies(libclang ${GENERATED_HEADERS} clang-headers)
|
2011-03-13 06:01:58 +08:00
|
|
|
|
2012-05-15 16:58:48 +08:00
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(libclang
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "libclang"
|
|
|
|
VERSION ${LIBCLANG_LIBRARY_VERSION}
|
|
|
|
DEFINE_SYMBOL _CINDEX_LIB_)
|
|
|
|
else()
|
|
|
|
set_target_properties(libclang
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "clang"
|
|
|
|
VERSION ${LIBCLANG_LIBRARY_VERSION}
|
|
|
|
DEFINE_SYMBOL _CINDEX_LIB_)
|
|
|
|
endif()
|
2011-03-13 23:10:24 +08:00
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2011-03-14 22:32:16 +08:00
|
|
|
set(LIBCLANG_LINK_FLAGS
|
2012-04-21 06:07:11 +08:00
|
|
|
"-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip")
|
2011-03-13 23:10:24 +08:00
|
|
|
set_target_properties(libclang
|
|
|
|
PROPERTIES
|
|
|
|
LINK_FLAGS "${LIBCLANG_LINK_FLAGS}"
|
|
|
|
INSTALL_NAME_DIR "@executable_path/../lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
set(LIBCLANG_STATIC_TARGET_NAME libclang_static)
|
|
|
|
else()
|
|
|
|
set(LIBCLANG_STATIC_TARGET_NAME libclang)
|
2011-03-13 06:01:58 +08:00
|
|
|
endif()
|
2011-03-13 12:28:29 +08:00
|
|
|
|
2011-03-13 23:10:24 +08:00
|
|
|
if( NOT BUILD_SHARED_LIBS AND NOT WIN32 )
|
|
|
|
add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES})
|
2012-06-21 09:30:21 +08:00
|
|
|
target_link_libraries(${LIBCLANG_STATIC_TARGET_NAME} ${LIBRARIES})
|
2013-03-30 05:51:40 +08:00
|
|
|
add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS} clang-headers)
|
2011-03-13 23:10:24 +08:00
|
|
|
|
|
|
|
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
|
|
|
|
PROPERTIES
|
2012-05-15 16:58:48 +08:00
|
|
|
OUTPUT_NAME "clang")
|
2011-03-13 23:10:24 +08:00
|
|
|
endif()
|