[libcxx-commits] [PATCH] D100221: [libcxx] [test] Add a separate 'windows-dll' feature to check for

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 22 02:12:49 PDT 2021


mstorsjo updated this revision to Diff 339528.
mstorsjo added a comment.

Look for `_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS` in `compilerMacros(cfg)` instead of looking at the `cfg.enable_shared` flag.

This is a fairly straightforward approach which works fine (when looking at libcxx itself, but doesn't generalize to other C++ libraries), but only works on Windows (but we have less need to distinguish between shared and static on other platforms). This avoids needing to do binary inspections to see how it ends up linked.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100221/new/

https://reviews.llvm.org/D100221

Files:
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -153,6 +153,7 @@
 DEFAULT_FEATURES += [
   Feature(name='darwin', when=lambda cfg: '__APPLE__' in compilerMacros(cfg)),
   Feature(name='windows', when=lambda cfg: '_WIN32' in compilerMacros(cfg)),
+  Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and not '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' in compilerMacros(cfg)),
   Feature(name='linux', when=lambda cfg: '__linux__' in compilerMacros(cfg)),
   Feature(name='netbsd', when=lambda cfg: '__NetBSD__' in compilerMacros(cfg)),
   Feature(name='freebsd', when=lambda cfg: '__FreeBSD__' in compilerMacros(cfg))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100221.339528.patch
Type: text/x-patch
Size: 791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210422/72d94dd2/attachment.bin>


More information about the libcxx-commits mailing list