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
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')