本文整理汇总了Python中libcxx.compiler.CXXCompiler.hasCompileFlag方法的典型用法代码示例。如果您正苦于以下问题:Python CXXCompiler.hasCompileFlag方法的具体用法?Python CXXCompiler.hasCompileFlag怎么用?Python CXXCompiler.hasCompileFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libcxx.compiler.CXXCompiler
的用法示例。
在下文中一共展示了CXXCompiler.hasCompileFlag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Configuration
# 需要导入模块: from libcxx.compiler import CXXCompiler [as 别名]
# 或者: from libcxx.compiler.CXXCompiler import hasCompileFlag [as 别名]
#.........这里部分代码省略.........
self.config.available_features.add(cxx_type)
self.config.available_features.add('%s-%s.%s' % (
cxx_type, maj_v, min_v))
def configure_src_root(self):
self.libcxx_src_root = self.get_lit_conf(
'libcxx_src_root', os.path.dirname(self.config.test_source_root))
def configure_obj_root(self):
self.libcxx_obj_root = self.get_lit_conf('libcxx_obj_root')
def configure_cxx_library_root(self):
self.cxx_library_root = self.get_lit_conf('cxx_library_root',
self.libcxx_obj_root)
def configure_use_system_cxx_lib(self):
# This test suite supports testing against either the system library or
# the locally built one; the former mode is useful for testing ABI
# compatibility between the current headers and a shipping dynamic
# library.
self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib')
if self.use_system_cxx_lib is None:
# Default to testing against the locally built libc++ library.
self.use_system_cxx_lib = False
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
def configure_use_clang_verify(self):
'''If set, run clang with -verify on failing tests.'''
self.use_clang_verify = self.get_lit_bool('use_clang_verify')
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.hasCompileFlag(
['-Xclang', '-verify-ignore-unexpected'])
self.lit_config.note(
"inferred use_clang_verify as: %r" % self.use_clang_verify)
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
# default value. Otherwise we default to internal on Windows and
# external elsewhere, as bash on Windows is usually very slow.
use_lit_shell_default = os.environ.get('LIT_USE_INTERNAL_SHELL')
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != '0'
else:
use_lit_shell_default = sys.platform == 'win32'
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool('use_lit_shell',
use_lit_shell_default)
self.execute_external = not use_lit_shell
def configure_ccache(self):
use_ccache_default = os.environ.get('LIBCXX_USE_CCACHE') is not None
use_ccache = self.get_lit_bool('use_ccache', use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
self.lit_config.note('enabling ccache')
def configure_features(self):
additional_features = self.get_lit_conf('additional_features')
if additional_features:
for f in additional_features.split(','):
self.config.available_features.add(f.strip())
示例2: Configuration
# 需要导入模块: from libcxx.compiler import CXXCompiler [as 别名]
# 或者: from libcxx.compiler.CXXCompiler import hasCompileFlag [as 别名]
#.........这里部分代码省略.........
cxx_type = self.cxx.type
if cxx_type is not None:
assert self.cxx.version is not None
maj_v, min_v, _ = self.cxx.version
self.config.available_features.add(cxx_type)
self.config.available_features.add("%s-%s.%s" % (cxx_type, maj_v, min_v))
def configure_src_root(self):
self.libcxx_src_root = self.get_lit_conf("libcxx_src_root", os.path.dirname(self.config.test_source_root))
def configure_obj_root(self):
self.libcxx_obj_root = self.get_lit_conf("libcxx_obj_root")
def configure_cxx_library_root(self):
self.cxx_library_root = self.get_lit_conf("cxx_library_root", self.libcxx_obj_root)
def configure_use_system_cxx_lib(self):
# This test suite supports testing against either the system library or
# the locally built one; the former mode is useful for testing ABI
# compatibility between the current headers and a shipping dynamic
# library.
self.use_system_cxx_lib = self.get_lit_bool("use_system_cxx_lib")
if self.use_system_cxx_lib is None:
# Default to testing against the locally built libc++ library.
self.use_system_cxx_lib = False
self.lit_config.note("inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
def configure_use_clang_verify(self):
"""If set, run clang with -verify on failing tests."""
self.use_clang_verify = self.get_lit_bool("use_clang_verify")
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.hasCompileFlag(["-Xclang", "-verify-ignore-unexpected"])
self.lit_config.note("inferred use_clang_verify as: %r" % self.use_clang_verify)
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
# default value. Otherwise we default to internal on Windows and
# external elsewhere, as bash on Windows is usually very slow.
use_lit_shell_default = os.environ.get("LIT_USE_INTERNAL_SHELL")
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != "0"
else:
use_lit_shell_default = sys.platform == "win32"
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool("use_lit_shell", use_lit_shell_default)
self.execute_external = not use_lit_shell
def configure_ccache(self):
use_ccache_default = os.environ.get("LIBCXX_USE_CCACHE") is not None
use_ccache = self.get_lit_bool("use_ccache", use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
self.lit_config.note("enabling ccache")
def configure_features(self):
additional_features = self.get_lit_conf("additional_features")
if additional_features:
for f in additional_features.split(","):
self.config.available_features.add(f.strip())
# Figure out which of the required locales we support
locales = {
示例3: Configuration
# 需要导入模块: from libcxx.compiler import CXXCompiler [as 别名]
# 或者: from libcxx.compiler.CXXCompiler import hasCompileFlag [as 别名]
#.........这里部分代码省略.........
def configure_cxx_stdlib_under_test(self):
self.cxx_stdlib_under_test = self.get_lit_conf(
'cxx_stdlib_under_test', 'libc++')
if self.cxx_stdlib_under_test not in \
['libc++', 'libstdc++', 'cxx_default']:
self.lit_config.fatal(
'unsupported value for "cxx_stdlib_under_test": %s'
% self.cxx_stdlib_under_test)
self.config.available_features.add(self.cxx_stdlib_under_test)
if self.cxx_stdlib_under_test == 'libstdc++':
self.config.available_features.add('libstdc++')
# Manually enable the experimental and filesystem tests for libstdc++
# if the options aren't present.
# FIXME this is a hack.
if self.get_lit_conf('enable_experimental') is None:
self.config.enable_experimental = 'true'
if self.get_lit_conf('enable_filesystem') is None:
self.config.enable_filesystem = 'true'
def configure_use_clang_verify(self):
'''If set, run clang with -verify on failing tests.'''
self.use_clang_verify = self.get_lit_bool('use_clang_verify')
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.isVerifySupported()
if self.use_clang_verify:
self.config.available_features.add('verify-support')
self.lit_config.note(
"inferred use_clang_verify as: %r" % self.use_clang_verify)
def configure_use_thread_safety(self):
'''If set, run clang with -verify on failing tests.'''
has_thread_safety = self.cxx.hasCompileFlag('-Werror=thread-safety')
if has_thread_safety:
self.cxx.compile_flags += ['-Werror=thread-safety']
self.config.available_features.add('thread-safety')
self.lit_config.note("enabling thread-safety annotations")
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
# default value. Otherwise we ask the target_info.
use_lit_shell_default = os.environ.get('LIT_USE_INTERNAL_SHELL')
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != '0'
else:
use_lit_shell_default = self.target_info.use_lit_shell_default()
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool('use_lit_shell',
use_lit_shell_default)
self.execute_external = not use_lit_shell
def configure_ccache(self):
use_ccache_default = os.environ.get('LIBCXX_USE_CCACHE') is not None
use_ccache = self.get_lit_bool('use_ccache', use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
self.lit_config.note('enabling ccache')
def configure_features(self):
additional_features = self.get_lit_conf('additional_features')
if additional_features:
for f in additional_features.split(','):
self.config.available_features.add(f.strip())
示例4: Configuration
# 需要导入模块: from libcxx.compiler import CXXCompiler [as 别名]
# 或者: from libcxx.compiler.CXXCompiler import hasCompileFlag [as 别名]
#.........这里部分代码省略.........
self.libcxx_src_root = self.get_lit_conf("libcxx_src_root", os.path.dirname(self.config.test_source_root))
def configure_obj_root(self):
self.project_obj_root = self.get_lit_conf("project_obj_root")
self.libcxx_obj_root = self.get_lit_conf("libcxx_obj_root")
if not self.libcxx_obj_root and self.project_obj_root is not None:
possible_root = os.path.join(self.project_obj_root, "projects", "libcxx")
if os.path.isdir(possible_root):
self.libcxx_obj_root = possible_root
else:
self.libcxx_obj_root = self.project_obj_root
def configure_cxx_library_root(self):
self.cxx_library_root = self.get_lit_conf("cxx_library_root", self.libcxx_obj_root)
self.cxx_runtime_root = self.get_lit_conf("cxx_runtime_root", self.cxx_library_root)
def configure_use_system_cxx_lib(self):
# This test suite supports testing against either the system library or
# the locally built one; the former mode is useful for testing ABI
# compatibility between the current headers and a shipping dynamic
# library.
self.use_system_cxx_lib = self.get_lit_bool("use_system_cxx_lib")
if self.use_system_cxx_lib is None:
# Default to testing against the locally built libc++ library.
self.use_system_cxx_lib = False
self.lit_config.note("inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
def configure_use_clang_verify(self):
"""If set, run clang with -verify on failing tests."""
self.use_clang_verify = self.get_lit_bool("use_clang_verify")
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.hasCompileFlag(["-Xclang", "-verify-ignore-unexpected"])
self.lit_config.note("inferred use_clang_verify as: %r" % self.use_clang_verify)
def configure_use_thread_safety(self):
"""If set, run clang with -verify on failing tests."""
has_thread_safety = self.cxx.hasCompileFlag("-Werror=thread-safety")
if has_thread_safety:
self.cxx.compile_flags += ["-Werror=thread-safety"]
self.config.available_features.add("thread-safety")
self.lit_config.note("enabling thread-safety annotations")
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
# default value. Otherwise we ask the target_info.
use_lit_shell_default = os.environ.get("LIT_USE_INTERNAL_SHELL")
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != "0"
else:
use_lit_shell_default = self.target_info.use_lit_shell_default()
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool("use_lit_shell", use_lit_shell_default)
self.execute_external = not use_lit_shell
def configure_ccache(self):
use_ccache_default = os.environ.get("LIBCXX_USE_CCACHE") is not None
use_ccache = self.get_lit_bool("use_ccache", use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
self.lit_config.note("enabling ccache")
def configure_features(self):
示例5: Configuration
# 需要导入模块: from libcxx.compiler import CXXCompiler [as 别名]
# 或者: from libcxx.compiler.CXXCompiler import hasCompileFlag [as 别名]
#.........这里部分代码省略.........
def configure_obj_root(self):
self.project_obj_root = self.get_lit_conf('project_obj_root')
self.libcxx_obj_root = self.get_lit_conf('libcxx_obj_root')
if not self.libcxx_obj_root and self.project_obj_root is not None:
possible_root = os.path.join(self.project_obj_root, 'projects', 'libcxx')
if os.path.isdir(possible_root):
self.libcxx_obj_root = possible_root
else:
self.libcxx_obj_root = self.project_obj_root
def configure_cxx_library_root(self):
self.cxx_library_root = self.get_lit_conf('cxx_library_root',
self.libcxx_obj_root)
def configure_use_system_cxx_lib(self):
# This test suite supports testing against either the system library or
# the locally built one; the former mode is useful for testing ABI
# compatibility between the current headers and a shipping dynamic
# library.
self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib')
if self.use_system_cxx_lib is None:
# Default to testing against the locally built libc++ library.
self.use_system_cxx_lib = False
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
def configure_use_clang_verify(self):
'''If set, run clang with -verify on failing tests.'''
self.use_clang_verify = self.get_lit_bool('use_clang_verify')
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.hasCompileFlag(
['-Xclang', '-verify-ignore-unexpected'])
self.lit_config.note(
"inferred use_clang_verify as: %r" % self.use_clang_verify)
def configure_execute_external(self):
# Choose between lit's internal shell pipeline runner and a real shell.
# If LIT_USE_INTERNAL_SHELL is in the environment, we use that as the
# default value. Otherwise we ask the target_info.
use_lit_shell_default = os.environ.get('LIT_USE_INTERNAL_SHELL')
if use_lit_shell_default is not None:
use_lit_shell_default = use_lit_shell_default != '0'
else:
use_lit_shell_default = self.target_info.use_lit_shell_default()
# Check for the command line parameter using the default value if it is
# not present.
use_lit_shell = self.get_lit_bool('use_lit_shell',
use_lit_shell_default)
self.execute_external = not use_lit_shell
def configure_ccache(self):
use_ccache_default = os.environ.get('LIBCXX_USE_CCACHE') is not None
use_ccache = self.get_lit_bool('use_ccache', use_ccache_default)
if use_ccache:
self.cxx.use_ccache = True
self.lit_config.note('enabling ccache')
def configure_features(self):
additional_features = self.get_lit_conf('additional_features')
if additional_features:
for f in additional_features.split(','):
self.config.available_features.add(f.strip())
self.target_info.add_locale_features(self.config.available_features)