forked from OSchip/llvm-project
Revert "libclang: Add static build support for Windows" and
follow-up "libclang: Make shared object symbol exporting by default" This reverts commit7a7c753b0c
. This reverts commit7ff1f55a12
. They broke building libclang.dll on Windows, see https://reviews.llvm.org/D74564
This commit is contained in:
parent
6f4d9d1029
commit
e84444781a
|
@ -18,23 +18,14 @@
|
|||
|
||||
LLVM_CLANG_C_EXTERN_C_BEGIN
|
||||
|
||||
/* Windows DLL import/export. */
|
||||
#ifndef CINDEX_NO_EXPORTS
|
||||
#define CINDEX_EXPORTS
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#ifdef CINDEX_EXPORTS
|
||||
#ifdef _CINDEX_LIB_
|
||||
#define CINDEX_LINKAGE __declspec(dllexport)
|
||||
#else
|
||||
#define CINDEX_LINKAGE __declspec(dllimport)
|
||||
#endif
|
||||
/* MSVC DLL import/export. */
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _CINDEX_LIB_
|
||||
#define CINDEX_LINKAGE __declspec(dllexport)
|
||||
#else
|
||||
#define CINDEX_LINKAGE __declspec(dllimport)
|
||||
#endif
|
||||
#elif defined(CINDEX_EXPORTS) && defined(__GNUC__)
|
||||
#define CINDEX_LINKAGE __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#ifndef CINDEX_LINKAGE
|
||||
#else
|
||||
#define CINDEX_LINKAGE
|
||||
#endif
|
||||
|
||||
|
|
|
@ -77,11 +77,11 @@ if(MSVC)
|
|||
set(LLVM_EXPORTED_SYMBOL_FILE)
|
||||
endif()
|
||||
|
||||
if(LLVM_ENABLE_PIC OR NOT LIBCLANG_BUILD_STATIC)
|
||||
if(LLVM_ENABLE_PIC OR WIN32)
|
||||
set(ENABLE_SHARED SHARED)
|
||||
endif()
|
||||
|
||||
if(NOT LLVM_ENABLE_PIC OR LIBCLANG_BUILD_STATIC)
|
||||
if((NOT LLVM_ENABLE_PIC OR LIBCLANG_BUILD_STATIC) AND NOT WIN32)
|
||||
set(ENABLE_STATIC STATIC)
|
||||
endif()
|
||||
|
||||
|
@ -113,14 +113,6 @@ add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} INSTALL_WITH_TOOLCH
|
|||
Support
|
||||
)
|
||||
|
||||
if(ENABLE_STATIC)
|
||||
foreach(name libclang obj.libclang libclang_static)
|
||||
if (TARGET ${name})
|
||||
target_compile_definitions(${name} PUBLIC CINDEX_NO_EXPORTS)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(ENABLE_SHARED)
|
||||
if(WIN32)
|
||||
set_target_properties(libclang
|
||||
|
|
Loading…
Reference in New Issue