[libcxx-commits] [PATCH] D102045: [libc++] Provide 'buildhost-<platform> feature for the tests.

Vlad Vereschaka via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 6 21:32:44 PDT 2021

vvereschaka created this revision.
vvereschaka added a reviewer: ldionne.
vvereschaka added a project: libc++.
Herald added subscribers: mstorsjo, arichardson.
vvereschaka requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

The target platform could differ from the host platform for the cross platform builds. Some tests are depended on the build host features and they need to determine a proper platform environment.

This commit adds a build host platform name feature for the libc++ tests in format `buildhost-<platform>`, such as `buildhost-linux`, `buildhost-darwin`,  `buildhost-windows` & etc.

The Windows host gets two features: one `buildhost-windows` and another based on Windows "sub-system", such as `buildhost-win32`, `buildhost-cygwin` & etc.

  rG LLVM Github Monorepo



Index: libcxx/utils/libcxx/test/features.py
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -159,6 +159,14 @@
   Feature(name='freebsd', when=lambda cfg: '__FreeBSD__' in compilerMacros(cfg))
+# Add features representing the build host platform name.
+# The build host could differ from the target platform for the cross-platform builds.
+  Feature(name='buildhost-{}'.format(sys.platform.lower().strip())),
+  # sys.platform can be represented by "sub-system" on Windows host, such as 'win32', 'cygwin', 'mingw' & etc.
+  # Here is a consolidated feature for the build host plaform name on Windows.
+  Feature(name='buildhost-windows', when=lambda cfg: platform.system().lower().startswith('windows'))
 # Detect whether GDB is on the system, and if so add a substitution to access it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102045.343574.patch
Type: text/x-patch
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210507/3d3ba844/attachment-0001.bin>

More information about the libcxx-commits mailing list