Allow enabling/disabling testing with module using env LIBCXX_USE_MODULES=1
authorEric Fiselier <eric@efcs.ca>
Tue, 6 Dec 2016 00:01:04 +0000 (00:01 +0000)
committerEric Fiselier <eric@efcs.ca>
Tue, 6 Dec 2016 00:01:04 +0000 (00:01 +0000)
The Clang modules implementation breaks enough that libc++ needs an easy way
to enable/disable using modules on the Zorg builders. Editing Zorg itself
requires a buildmaster restart which only happens weekly. This patch
allows LIBCXX_USE_MODULES to be used to enable/disable the feature,
allowing the buildslave to disable it as need be.

llvm-svn: 288736

libcxx/test/libcxx/test/config.py

index 849b163..f9ab22f 100644 (file)
@@ -736,7 +736,10 @@ class Configuration(object):
         if platform.system() != 'Darwin':
             modules_flags += ['-Xclang', '-fmodules-local-submodule-visibility']
         supports_modules = self.cxx.hasCompileFlag(modules_flags)
-        enable_modules = self.get_lit_bool('enable_modules', False)
+        enable_modules_default = supports_modules and \
+            os.environ.get('LIBCXX_USE_MODULES') is not None
+        enable_modules = self.get_lit_bool('enable_modules',
+                                           enable_modules_default)
         if enable_modules and not supports_modules:
             self.lit_config.fatal(
                 '-fmodules is enabled but not supported by the compiler')