File tree Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,13 @@ if (LLVM_LINK_LLVM_DYLIB AND BUILD_SHARED_LIBS)
935
935
message (FATAL_ERROR "Cannot enable BUILD_SHARED_LIBS with LLVM_LINK_LLVM_DYLIB. We recommend disabling BUILD_SHARED_LIBS." )
936
936
endif ()
937
937
938
+ set (LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS OFF )
939
+ if (LLVM_BUILD_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS OR LLVM_ENABLE_PLUGINS )
940
+ # Export annotations for LLVM must be enabled if building as a shared lib or
941
+ # enabling plugins.
942
+ set (LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS ON )
943
+ endif ()
944
+
938
945
option (LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF )
939
946
if (CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES )))
940
947
set (LLVM_USE_HOST_TOOLS ON )
Original file line number Diff line number Diff line change 110
110
/* Define if building LLVM with BUILD_SHARED_LIBS */
111
111
#cmakedefine LLVM_BUILD_SHARED_LIBS
112
112
113
+ /* Define if exporting LLVM public interface for shared library */
114
+ #cmakedefine LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS
115
+
113
116
/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */
114
117
#cmakedefine LLVM_FORCE_USE_OLD_TOOLCHAIN ${LLVM_FORCE_USE_OLD_TOOLCHAIN}
115
118
Original file line number Diff line number Diff line change 184
184
// Marker to add to classes or functions in public headers that should not have
185
185
// export macros added to them by the clang tool
186
186
#define LLVM_ABI_NOT_EXPORTED
187
- #if defined(LLVM_BUILD_LLVM_DYLIB) || defined(LLVM_BUILD_SHARED_LIBS) || \
188
- defined (LLVM_ENABLE_PLUGINS)
189
- // Some libraries like those for tablegen are linked in to tools that used
190
- // in the build so can't depend on the llvm shared library. If export macros
191
- // were left enabled when building these we would get duplicate or
192
- // missing symbol linker errors on windows.
193
- #if defined(LLVM_BUILD_STATIC)
194
- #define LLVM_ABI
195
- #define LLVM_ABI_FRIEND
196
- #define LLVM_TEMPLATE_ABI
197
- #define LLVM_EXPORT_TEMPLATE
198
- #define LLVM_ABI_EXPORT
199
- #elif defined(_WIN32) && !defined(__MINGW32__)
187
+ #if defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS) && !defined(LLVM_BUILD_STATIC)
188
+ #if defined(_WIN32) && !defined(__MINGW32__)
200
189
#if defined(LLVM_EXPORTS)
201
190
#define LLVM_ABI __declspec (dllexport)
202
191
#define LLVM_TEMPLATE_ABI
222
211
#define LLVM_EXPORT_TEMPLATE
223
212
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
224
213
#endif
225
- #else
214
+ #endif
215
+ #if !defined(LLVM_ABI)
226
216
#define LLVM_ABI
227
217
#define LLVM_ABI_FRIEND
228
218
#define LLVM_TEMPLATE_ABI
You can’t perform that action at this time.
0 commit comments