[libcxx-commits] [libcxx] 621e437 - [libc++] Provide 'buildhost=<platform> feature for the tests.

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 08:49:57 PDT 2021


Author: Vladimir Vereschaka
Date: 2021-09-07T11:49:53-04:00
New Revision: 621e437e0357b342e9c1827044744bda05901489

URL: https://github.com/llvm/llvm-project/commit/621e437e0357b342e9c1827044744bda05901489
DIFF: https://github.com/llvm/llvm-project/commit/621e437e0357b342e9c1827044744bda05901489.diff

LOG: [libc++] Provide 'buildhost=<platform> feature for the tests.

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.

Differential Revision: https://reviews.llvm.org/D102045

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index a37355c53c618..ffeb721cf09ea 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -150,6 +150,14 @@
   Feature(name='freebsd', when=lambda cfg: '__FreeBSD__' in compilerMacros(cfg))
 ]
 
+# Add features representing the build host platform name.
+# The build host could 
diff er from the target platform for cross-compilation.
+DEFAULT_FEATURES += [
+  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.
 DEFAULT_FEATURES += [


        


More information about the libcxx-commits mailing list