Reverting "Build libclang as a static library too."

This reverts commit r127556. It breaks the build for MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127564 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Oscar Fuentes 2011-03-13 04:28:29 +00:00
Родитель e9cd9c0016
Коммит d9e9b8f195
1 изменённых файлов: 26 добавлений и 40 удалений

Просмотреть файл

@ -1,3 +1,5 @@
set(SHARED_LIBRARY TRUE)
set(LLVM_USED_LIBS
clangFrontend
clangDriver
@ -13,7 +15,7 @@ set( LLVM_LINK_COMPONENTS
mc
)
set(SOURCES
add_clang_library(libclang
CIndex.cpp
CIndexCXX.cpp
CIndexCodeCompletion.cpp
@ -27,16 +29,6 @@ set(SOURCES
../../include/clang-c/Index.h
)
if( LLVM_ENABLE_PIC AND NOT WIN32 )
set(SHARED_LIBRARY TRUE)
add_clang_library(libclang ${SOURCES})
set_target_properties(libclang
PROPERTIES
OUTPUT_NAME "clang"
VERSION ${LIBCLANG_LIBRARY_VERSION}
DEFINE_SYMBOL _CINDEX_LIB_)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Darwin-specific linker flags
@ -51,24 +43,18 @@ if( LLVM_ENABLE_PIC AND NOT WIN32 )
INSTALL_NAME_DIR "@executable_path/../lib")
endif()
set(LIBCLANG_STATIC_TARGET_NAME libclang_static)
else()
set(LIBCLANG_STATIC_TARGET_NAME libclang)
endif()
if( NOT BUILD_SHARED_LIBS )
add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES})
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
PROPERTIES
OUTPUT_NAME "clang")
# Versioning information
set_target_properties(libclang PROPERTIES VERSION ${LIBCLANG_LIBRARY_VERSION})
if(MSVC)
# windows.h doesn't compile with /Za
get_target_property(NON_ANSI_COMPILE_FLAGS ${LIBCLANG_STATIC_TARGET_NAME}
COMPILE_FLAGS)
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_STATIC_TARGET_NAME} PROPERTIES
COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
endif()
endif()
set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
endif(MSVC)
set_target_properties(libclang
PROPERTIES
PREFIX "" # Otherwise we get liblibclang.so
LINKER_LANGUAGE CXX
DEFINE_SYMBOL _CINDEX_LIB_)