本文整理汇总了Python中src.build.build_options.OPTIONS.is_optimized_build方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_optimized_build方法的具体用法?Python OPTIONS.is_optimized_build怎么用?Python OPTIONS.is_optimized_build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.is_optimized_build方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_current_configure_options
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_optimized_build [as 别名]
def check_current_configure_options(parsed_args):
"""Checks if the current configure options are good for comparison.
Args:
parsed_args: An argparse.Namespace object.
"""
# Require --opt build.
if not OPTIONS.is_optimized_build() and not parsed_args.allow_debug_builds:
sys.exit(
'configure option bad: either --opt or --official-build '
'must be specified. If you want to compare debug builds, '
'please use --allow-debug-builds.')
示例2: _filter
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_optimized_build [as 别名]
def _filter(vars):
if vars.is_executable():
return False
if vars.get_module_name() == 'libskia':
if not OPTIONS.is_optimized_build():
# Enable basic optimizations for SKIA as it otherwise fails as it
# refers to unimplemented FT_Get_FSType_Flags. For some reason using
# -ffunction-sections with --gc-sections did not solve the problem
# here.
vars.get_cflags().append('-O1')
vars.get_shared_deps().append('libcompiler_rt')
return True
示例3: generate_binaries_depending_ninjas
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_optimized_build [as 别名]
def generate_binaries_depending_ninjas(_):
if (not OPTIONS.is_bare_metal_i686() or
not OPTIONS.is_optimized_build() or
# None of the targets analyzed are currently built in the open source
# repository.
open_source.is_open_source_repo() or
# Run the checker only when --disable-debug-code is specified. Locations
# of static initializers differ depending on the debug-code option.
OPTIONS.is_debug_code_enabled() or
# The checker only works with debug symbols.
not OPTIONS.is_debug_info_enabled()):
# The static analysis tool's output varies between debug and non-debug
# builds, so we pick non-debug as the default.
return
n = ninja_generator.NinjaGenerator('analyze_static_initializers')
script = staging.as_staging(
'android/external/chromium_org/tools/linux/dump-static-initializers.py')
n.rule('analyze_static_initializers',
command=('python src/build/run_python %s -d $in | head --lines=-1 | '
'egrep -ve \'^# .*\.cpp \' |'
'sed -e \'s/ T\.[0-9]*/ T.XXXXX/\' |'
'diff -u $expect - && touch $out' %
script),
description='analyze_static_initializers $in')
libraries = build_common.CHECKED_LIBRARIES
libraries_fullpath = [
os.path.join(build_common.get_load_library_path(), lib)
for lib in libraries]
for library in zip(libraries, libraries_fullpath):
# You can manually update the text files by running
# src/build/update_static_initializer_expectations.py.
expect = 'src/build/dump-static-initializers-%s-expected.txt' % library[0]
result_path = os.path.join(build_common.get_build_dir(),
'dump_static_initializers',
'dump_static_initializers.%s.result' %
library[0])
n.build(result_path, 'analyze_static_initializers', library[1],
variables={'out': result_path, 'expect': expect},
# Add |libraries_fullpath| to implicit= not to run the analyzer
# script until all libraries in |libraries_fullpath| become ready.
# This makes it easy to use
# update_static_initializer_expectations.py especially when you
# remove global variables from two or more libraries at the same
# time.
implicit=[script, expect] + libraries_fullpath)
示例4: _get_opt_suffix
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_optimized_build [as 别名]
def _get_opt_suffix():
return "_opt" if OPTIONS.is_optimized_build() else "_dbg"
示例5: filter_params_for_harfbuzz
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_optimized_build [as 别名]
def filter_params_for_harfbuzz(vars):
if OPTIONS.is_nacl_x86_64() and not OPTIONS.is_optimized_build():
# To work around nativeclient:3844, use -O1 even when --opt is not
# specified.
# TODO(nativeclient:3844): Remove this.
vars.get_cflags().append("-O1")