File tree 2 files changed +9
-4
lines changed
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)
108
108
endif ()
109
109
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} )
110
110
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)
113
120
endif ()
114
121
115
122
set (libs ${name} )
Original file line number Diff line number Diff line change 31
31
// Marker to add to classes or functions in public headers that should not have
32
32
// export macros added to them by the clang tool
33
33
#define CLANG_ABI_NOT_EXPORTED
34
- #if defined(LLVM_BUILD_LLVM_DYLIB) || defined(LLVM_BUILD_SHARED_LIBS)
35
34
// Some libraries like those for tablegen are linked in to tools that used
36
35
// in the build so can't depend on the llvm shared library. If export macros
37
36
// were left enabled when building these we would get duplicate or
64
63
#define CLANG_TEMPLATE_ABI
65
64
#define CLANG_EXPORT_TEMPLATE
66
65
#endif
67
- #endif
68
66
69
67
#endif
You can’t perform that action at this time.
0 commit comments