[PATCH] D90075: [libunwind] Add -Wno-dll-attribute-on-redeclaration when building for windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 13:27:20 PDT 2020


mstorsjo created this revision.
mstorsjo added reviewers: libunwind, compnerd, rnk.
Herald added subscribers: llvm-commits, mgorny.
Herald added projects: LLVM, libunwind.
Herald added 1 blocking reviewer(s): libunwind.
mstorsjo requested review of this revision.

It's not worth trying to fix these warnings within libunwind, instead silence them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90075

Files:
  libunwind/CMakeLists.txt


Index: libunwind/CMakeLists.txt
===================================================================
--- libunwind/CMakeLists.txt
+++ libunwind/CMakeLists.txt
@@ -203,6 +203,14 @@
 
 add_compile_flags_if_supported(-Wno-suggest-override)
 
+if (WIN32)
+  # The headers lack matching dllexport attributes (_LIBUNWIND_EXPORT);
+  # silence the warning instead of cluttering the headers (which aren't
+  # necessarily the ones that the callers will use anyway) with the
+  # attributes.
+  add_compile_flags_if_supported(-Wno-dll-attribute-on-redeclaration)
+endif()
+
 if (LIBUNWIND_ENABLE_WERROR)
   add_compile_flags_if_supported(-Werror)
   add_compile_flags_if_supported(-WX)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90075.300395.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201023/91854bef/attachment.bin>


More information about the llvm-commits mailing list