2010-09-14 07:54:41 +08:00
|
|
|
set(LLVM_USED_LIBS
|
2011-07-10 04:00:58 +08:00
|
|
|
clangARCMigrate
|
2011-07-10 05:35:58 +08:00
|
|
|
clangRewrite
|
2010-09-14 07:54:41 +08:00
|
|
|
clangFrontend
|
|
|
|
clangDriver
|
|
|
|
clangSerialization
|
|
|
|
clangIndex
|
|
|
|
clangSema
|
|
|
|
clangAST
|
|
|
|
clangLex
|
|
|
|
clangBasic)
|
|
|
|
|
|
|
|
set( LLVM_LINK_COMPONENTS
|
2011-02-20 07:03:58 +08:00
|
|
|
support
|
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
|
2010-01-16 04:35:54 +08:00
|
|
|
CXCursor.cpp
|
2011-11-01 05:40:19 +08:00
|
|
|
CXCursor.h
|
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
|
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
|
|
|
|
2011-03-13 23:10:24 +08:00
|
|
|
if( LLVM_ENABLE_PIC )
|
|
|
|
set(SHARED_LIBRARY TRUE)
|
|
|
|
add_clang_library(libclang ${SOURCES})
|
2011-03-13 06:01:58 +08:00
|
|
|
|
2011-03-13 12:28:29 +08:00
|
|
|
set_target_properties(libclang
|
2011-03-13 06:01:58 +08:00
|
|
|
PROPERTIES
|
2011-04-10 10:29:27 +08:00
|
|
|
OUTPUT_NAME "libclang"
|
2011-03-13 23:10:24 +08:00
|
|
|
VERSION ${LIBCLANG_LIBRARY_VERSION}
|
|
|
|
DEFINE_SYMBOL _CINDEX_LIB_)
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2011-03-14 22:32:16 +08:00
|
|
|
set(LIBCLANG_LINK_FLAGS
|
|
|
|
"-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000")
|
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()
|
|
|
|
|
|
|
|
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 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})
|
|
|
|
|
|
|
|
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
|
|
|
|
PROPERTIES
|
2011-04-10 10:29:27 +08:00
|
|
|
OUTPUT_NAME "libclang")
|
2011-03-13 23:10:24 +08:00
|
|
|
endif()
|