File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,15 @@ macro(add_clang_library name)
108108 endif ()
109109 llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} )
110110
111- if (NOT ARG_SHARED AND NOT ARG_STATIC)
112- target_compile_definitions ("obj.${name} " PRIVATE CLANG_EXPORTS)
111+ if (MSVC AND NOT CLANG_LINK_CLANG_DYLIB)
112+ # Make sure all consumers also turn off visibility macros so there not trying to dllimport symbols.
113+ target_compile_definitions (${name} PUBLIC CLANG_BUILD_STATIC)
114+ if (TARGET "obj.${name} " )
115+ target_compile_definitions ("obj.${name} " PUBLIC CLANG_BUILD_STATIC)
116+ endif ()
117+ elseif (NOT ARG_SHARED AND NOT ARG_STATIC)
118+ # Clang component libraries linked in to clang-cpp are declared without SHARED or STATIC
119+ target_compile_definitions ("obj.${name} " PUBLIC CLANG_EXPORTS)
113120 endif ()
114121
115122 set (libs ${name} )
Original file line number Diff line number Diff line change 3131// Marker to add to classes or functions in public headers that should not have
3232// export macros added to them by the clang tool
3333#define CLANG_ABI_NOT_EXPORTED
34- #if defined(LLVM_BUILD_LLVM_DYLIB) || defined(LLVM_BUILD_SHARED_LIBS)
3534// Some libraries like those for tablegen are linked in to tools that used
3635// in the build so can't depend on the llvm shared library. If export macros
3736// were left enabled when building these we would get duplicate or
6463#define CLANG_TEMPLATE_ABI
6564#define CLANG_EXPORT_TEMPLATE
6665#endif
67- #endif
6866
6967#endif
You can’t perform that action at this time.
0 commit comments