Give lit.cfg's threading options default values when not defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -202,10 +202,10 @@ class Configuration(object):
|
|||||||
val = default
|
val = default
|
||||||
return val
|
return val
|
||||||
|
|
||||||
def get_lit_bool(self, name):
|
def get_lit_bool(self, name, default=None):
|
||||||
conf = self.get_lit_conf(name)
|
conf = self.get_lit_conf(name)
|
||||||
if conf is None:
|
if conf is None:
|
||||||
return None
|
return default
|
||||||
if conf.lower() in ('1', 'true'):
|
if conf.lower() in ('1', 'true'):
|
||||||
return True
|
return True
|
||||||
if conf.lower() in ('', '0', 'false'):
|
if conf.lower() in ('', '0', 'false'):
|
||||||
@@ -415,9 +415,8 @@ class Configuration(object):
|
|||||||
'-D__STDC_LIMIT_MACROS',
|
'-D__STDC_LIMIT_MACROS',
|
||||||
'-D__STDC_CONSTANT_MACROS']
|
'-D__STDC_CONSTANT_MACROS']
|
||||||
# Configure threading features.
|
# Configure threading features.
|
||||||
enable_threads = self.get_lit_bool('enable_threads')
|
enable_threads = self.get_lit_bool('enable_threads', True)
|
||||||
enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock')
|
enable_monotonic_clock = self.get_lit_bool('enable_monotonic_clock', True)
|
||||||
assert enable_threads is not None and enable_monotonic_clock is not None
|
|
||||||
if not enable_threads:
|
if not enable_threads:
|
||||||
self.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
|
self.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
|
||||||
self.config.available_features.add('libcpp-has-no-threads')
|
self.config.available_features.add('libcpp-has-no-threads')
|
||||||
|
Reference in New Issue
Block a user