当前位置: 首页>>代码示例>>Python>>正文


Python OPTIONS.is_debug_code_enabled方法代码示例

本文整理汇总了Python中build_options.OPTIONS.is_debug_code_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_debug_code_enabled方法的具体用法?Python OPTIONS.is_debug_code_enabled怎么用?Python OPTIONS.is_debug_code_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在build_options.OPTIONS的用法示例。


在下文中一共展示了OPTIONS.is_debug_code_enabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_build_type

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_debug_code_enabled [as 别名]
def get_build_type():
  # Android has three build types, 'user', 'userdebug', and 'eng'.
  # 'user' is a build with limited access permissions for production.
  # 'eng' is a development configuration with debugging code. See,
  # https://source.android.com/source/building-running.html#choose-a-target.
  # ARC uses 'user' only when debug code is disabled.
  if OPTIONS.is_debug_code_enabled():
    return 'eng'
  return 'user'
开发者ID:NaiveTorch,项目名称:ARC,代码行数:11,代码来源:build_common.py

示例2: generate_binaries_depending_ninjas

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_debug_code_enabled [as 别名]
def generate_binaries_depending_ninjas(_):
  if (not OPTIONS.is_nacl_x86_64() or
      not OPTIONS.is_optimized_build() or
      # emugl has a different set of static initializers than
      # graphics_translation.
      OPTIONS.enable_emugl() 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 %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)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:50,代码来源:config.py

示例3: _filter_libc_malloc_debug_leak

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_debug_code_enabled [as 别名]
def _filter_libc_malloc_debug_leak(vars):
  if vars.is_static():
    return False
  # This module should not be included for --opt --disable-debug-code,
  # and it is controlled by TARGET_BUILD_VARIANT in the Android.mk.
  assert OPTIONS.is_debug_code_enabled()
  # libc_malloc_debug_leak.so should not use lib_common.a. See comments
  # above.
  vars.get_whole_archive_deps().remove('libc_common')
  vars.get_shared_deps().append('libdl')
  # Linking libc.so instead of libc_logging.cpp does not work because
  # __libc_format_* functions in the file are __LIBC_HIDDEN.
  vars.get_sources().append(
      'android/bionic/libc/bionic/libc_logging.cpp')
  _remove_unnecessary_defines(vars)
  vars.get_generator_args()['is_system_library'] = True
  return True
开发者ID:NaiveTorch,项目名称:ARC,代码行数:19,代码来源:config.py

示例4: _add_runnable_ld_cflags

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_debug_code_enabled [as 别名]
def _add_runnable_ld_cflags(n):
  n.add_c_flags('-std=gnu99')
  if OPTIONS.is_arm():
    # If we specify -fstack-protector, the ARM compiler emits code
    # which requires relocation even for the code to be executed
    # before the self relocation. We disable the stack smashing
    # protector for the Bionic loader for now.
    # TODO(crbug.com/342292): Enable stack protector for the Bionic
    # loader on Bare Metal ARM.
    n.add_compiler_flags('-fno-stack-protector')
  n.add_compiler_flags(
      '-ffunction-sections', '-fdata-sections',
      # The loader does not need to export any symbols.
      '-fvisibility=hidden',
      '-W', '-Wno-unused', '-Wno-unused-parameter', '-Werror')

  # TODO(crbug.com/243244): Consider using -Wsystem-headers.
  n.add_include_paths('android/bionic/libc',
                      'android/bionic/libc/private',
                      'android/bionic/linker/arch/nacl')
  if OPTIONS.is_debug_code_enabled() or OPTIONS.is_bionic_loader_logging():
    n.add_defines('LINKER_DEBUG=1')
  else:
    n.add_defines('LINKER_DEBUG=0')
  n.add_defines('ANDROID_SMP=1')
  if OPTIONS.is_arm():
    n.add_defines('ANDROID_ARM_LINKER')
  elif OPTIONS.is_x86_64():
    n.add_defines('ANDROID_X86_64_LINKER')
    n.add_c_flags('-Wno-pointer-to-int-cast')
    n.add_c_flags('-Wno-int-to-pointer-cast')
  else:
    n.add_defines('ANDROID_X86_LINKER')
  if build_common.use_ndk_direct_execution():
    n.add_defines('USE_NDK_DIRECT_EXECUTION')

  if OPTIONS.is_bionic_loader_logging():
    n.add_defines('BIONIC_LOADER_LOGGING')
  _add_bare_metal_flags_to_ninja_generator(n)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:41,代码来源:config.py

示例5: build

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_debug_code_enabled [as 别名]
# version_defaults.mk sets this if there is no BUILD_ID set.
_BUILD_NUMBER = build_common.get_build_version()

os.environ['BUILD_DISPLAY_ID'] = _BUILD_NUMBER

# Non-tagged builds generate fingerprints that are longer than the maximum of 92
# characters allowed for system property values. Split the build ID in version
# and specific build to be within the limit.
if '-' in _BUILD_NUMBER:
  tokens = _BUILD_NUMBER.split('-')
  os.environ['BUILD_ID'] = tokens[0]
  os.environ['BUILD_NUMBER'] = '-'.join(tokens[1:])
else:
  os.environ['BUILD_ID'] = _BUILD_NUMBER
  os.environ['BUILD_NUMBER'] = _BUILD_NUMBER
if OPTIONS.is_debug_code_enabled():
  os.environ['BUILD_VERSION_TAGS'] = 'test-keys'
else:
  os.environ['BUILD_VERSION_TAGS'] = 'release-keys'

# "REL" means a release build (everything else is a dev build).
os.environ['PLATFORM_VERSION_CODENAME'] = 'REL'
os.environ['PLATFORM_VERSION'] = '4.4'
# SDK has to be pinned to correct level to avoid loading
# unsupported featured from app's APK file.
os.environ['PLATFORM_SDK_VERSION'] = '19'

# By convention, ro.product.brand, ro.product.manufacturer and ro.product.name
# are always in lowercase.
os.environ['PRODUCT_BRAND'] = 'chromium'
os.environ['PRODUCT_DEFAULT_LANGUAGE'] = 'en'
开发者ID:NaiveTorch,项目名称:ARC,代码行数:33,代码来源:generate_build_prop.py


注:本文中的build_options.OPTIONS.is_debug_code_enabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。