diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- 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 differ 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 += [