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


Python OPTIONS.is_debug_code_enabled方法代码示例

本文整理汇总了Python中src.build.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使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.build.build_options.OPTIONS的用法示例。


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

示例1: _generate_test_framework_ninjas

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [as 别名]
def _generate_test_framework_ninjas():
  # Build two versions of libgtest and libgmock that are built and linked with
  # STLport or libc++. It is used to build tests that depends on each library.
  _generate_gtest_ninja('libgtest', enable_libcxx=False)

  if not OPTIONS.run_tests():
    gtest_libcxx_instances = 0
  else:
    # libart-gtest.so, libarttest.so, and libnativebridgetest.so uses
    # libgtest_libc++.a. But when --disable-debug-code is specified,
    # libart-gtest.so is not built.
    if OPTIONS.is_debug_code_enabled():
      gtest_libcxx_instances = 3
    else:
      gtest_libcxx_instances = 2
  _generate_gtest_ninja('libgtest_libc++',
                        instances=gtest_libcxx_instances, enable_libcxx=True)

  # libartd.so for host uses libgtest_host.a. Although it is built with
  # libc++, it is not named libgtest_libc++_host.a by Android.mk.
  if OPTIONS.is_debug_code_enabled():
    _generate_gtest_ninja('libgtest_host', host=True, enable_libcxx=True)

  _generate_gmock_ninja('libgmock', enable_libcxx=False)
  _generate_gmock_ninja('libgmock_libc++', enable_libcxx=True)
开发者ID:epowers,项目名称:arc,代码行数:27,代码来源:config.py

示例2: _convert_launch_chrome_options_to_external_metadata

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [as 别名]
def _convert_launch_chrome_options_to_external_metadata(parsed_args):
  metadata = parsed_args.additional_metadata

  for definition in manager.get_metadata_definitions():
    value = getattr(parsed_args, definition.python_name, None)
    if value is not None:
      metadata[definition.name] = value

  if bool(parsed_args.jdb_port or parsed_args.gdb):
    metadata['disableChildPluginRetry'] = True
    metadata['disableHeartbeat'] = True
    metadata['sleepOnBlur'] = False

  if (parsed_args.mode == 'atftest' or parsed_args.mode == 'system' or
      OPTIONS.get_system_packages()):
    # An app may briefly go through empty stack while running
    # addAccounts() in account manager service.
    # TODO(igorc): Find a more precise detection mechanism to support GSF,
    # implement empty stack timeout, or add a flag if this case is more common.
    metadata['allowEmptyActivityStack'] = True

  command = _generate_shell_command(parsed_args)
  if command:
    metadata['shell'] = command

  metadata['isDebugCodeEnabled'] = OPTIONS.is_debug_code_enabled()

  return metadata
开发者ID:epowers,项目名称:arc,代码行数:30,代码来源:prep_launch_chrome.py

示例3: get_build_type

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.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:nehz,项目名称:google-arc,代码行数:11,代码来源:build_common.py

示例4: _filter_cflags_for_chromium_org

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [as 别名]
def _filter_cflags_for_chromium_org(vars):
  append_cflags = []
  # TODO(http://crbug.com/509945): Use Gold once it's ready.
  strip_flags = ['-fuse-ld=gold', '-march=pentium4', '-finline-limit=64']
  if OPTIONS.is_arm():
    # ARM clang does not support these flags.
    strip_flags.extend(['-fno-partial-inlining', '-fno-early-inlining',
                        '-fno-tree-copy-prop', '-fno-tree-loop-optimize',
                        '-fno-move-loop-invariants',
                        '-Wa,-mimplicit-it=always'])
  if not OPTIONS.is_bare_metal_build():
    # nacl-clang supports -Oz, which is more aggressive than -Os.
    strip_flags.append('-Os')
  # TODO(crbug.com/346783): Remove this once we NaCl'ize PageAllocator.cpp.
  # It is only necessary for NaCl, but we do this for linux as well
  # to minimize platform differences.
  append_cflags.append('-DMEMORY_TOOL_REPLACES_ALLOCATOR')
  _update_flags(vars, append_cflags, strip_flags)
  # -finline-limit=32 experimentally provides the smallest binary across
  # the ni and nx targets.  Also specify -finline-functions so all functions
  # are candidates for inlining.
  size_opts = ['-finline-limit=32', '-finline-functions']
  if not OPTIONS.is_bare_metal_build():
    # -Oz is not valid for asmflags, so just add it for C and C++.
    vars.get_conlyflags().append('-Oz')
    vars.get_cxxflags().append('-Oz')
  # With these flags, compilers will not emit .eh_frame* sections and
  # the size of libwebviewchromium.so reduces from 84MB to 75MB on L.
  # As these options disables libgcc's _Unwind_Backtrace, we keep
  # using them for non-production build. Note GDB and breakpad can
  # produce backtraces without .eh_frame.
  #
  # It is intentional this condition is inconsistent with
  # ninja_generator.py and make_to_ninja.py. Removing .eh_frame from
  # production binary did not make a significant difference for file
  # size of L. We would rather prefer keeping .eh_frame for
  # _Unwind_Backtrace.
  if not OPTIONS.is_debug_code_enabled():
    size_opts += ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
  vars.get_cflags()[:] = vars.get_cflags() + size_opts
  # dlopen fails for the following undefined reference without -mthumb
  # _ZN7WebCore26feLightingConstantsForNeonEv
  # TODO(crbug.com/358333): Investigate if this is actually needed.
  if OPTIONS.is_arm():
    vars.get_cflags().append('-mthumb')
  # OpenSSL makes wrong assumption that sizeof(long) == 8 under x86_64.
  # Remove the x86_64-specific include path to fall back to x86 config.
  # Note that this include path is set in many modules depending on OpenSSL,
  # not limited to third_party_openssl_openssl_gyp.a itself.
  if OPTIONS.is_nacl_x86_64():
    openssl_x64_include = (
        'android/external/chromium_org/third_party/openssl/config/x64')
    includes = vars.get_includes()
    if openssl_x64_include in includes:
      includes.remove(openssl_x64_include)
开发者ID:epowers,项目名称:arc,代码行数:57,代码来源:config.py

示例5: build_gms_core_or_use_prebuilt

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [as 别名]
  def build_gms_core_or_use_prebuilt(self):
    if OPTIONS.enable_art_aot():
      # Rule for pre-optimizing gms-core apk.
      boot_image_dir = os.path.join(build_common.get_android_fs_root(),
                                    'system/framework',
                                    build_common.get_art_isa())
      self.rule(
          'gms_core_apk_preoptimize',
          'src/build/gms_core_apk_preoptimize.py --input $in --output $out',
          description='Preoptimizing gmscore sub apks contained in $in')
      self.build(GmsCoreNinjaGenerator._APK_PATH,
                 'gms_core_apk_preoptimize',
                 GmsCoreNinjaGenerator._ORIGINAL_APK_PATH,
                 implicit=[toolchain.get_tool('java', 'dex2oat'),
                           os.path.join(boot_image_dir, 'boot.art'),
                           os.path.join(boot_image_dir, 'boot.oat')])

    if not OPTIONS.internal_apks_source_is_internal():
      return

    flags = '--eng' if OPTIONS.is_debug_code_enabled() else ''
    build_log = os.path.join('out/gms-core-build/build.log')
    command = ('internal/build/build.py gms-core %s > %s 2>&1 || '
               '(cat %s; exit 1)') % (flags, build_log, build_log)

    if OPTIONS.internal_apks_source() == 'internal-dev':
      # Only for local development.  play-services.apk dependes on jars below to
      # build, just to use ARC specific feature like ArcMessageBridge and
      # Tracing.  This dependency is a must-have for a clean build.  But this
      # dependency can cause unrelated framework change to trigger rebuild of
      # play-services.apk, which is very slow.  With this option, eng will self
      # manages the dependency, which is almost always satisfied.
      jars = []
    else:
      # Simply make these jars the dependencies of gms-core-build, which
      # references ArcMessage and ArcMessageBridge in the jar.  Note that these
      # jars changes often and is like to cause unnecessary rebuild of gms-core,
      # which is very slow.  We may think about a way to minimize the
      # dependency.
      #
      # See also: internal/mods/gms-core/vendor/unbundled_google/packages/ \
      #     OneUp/package/Android.mk
      #     OneUp/package/generate_package.mk
      jars = [
          build_common.get_build_path_for_jar('arc-services-framework',
                                              subpath='classes.jar'),
          build_common.get_build_path_for_jar('framework',
                                              subpath='classes.jar'),
      ]

    self.build(GmsCoreNinjaGenerator._ALL_OUTPUTS,
               'run_shell_command',
               implicit=['src/build/DEPS.arc-int'] + jars,
               variables={'command': command})
开发者ID:epowers,项目名称:arc,代码行数:56,代码来源:gms_core_ninja_generator.py

示例6: generate_binaries_depending_ninjas

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [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)
开发者ID:epowers,项目名称:arc,代码行数:47,代码来源:config.py

示例7: _get_tool_map

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_code_enabled [as 别名]

#.........这里部分代码省略.........
          'ld': os.path.join(get_nacl_toolchain_path(), 'x86_64-nacl-g++'),
          'asm': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-clang'),
          'ar': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-ar'),
          'nm': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-nm'),
          'objcopy': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-objcopy'),
          'objdump': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-objdump'),
          'addr2line': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-addr2line'),
          'strip': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-strip'),
          'runner': ' '.join(get_nacl_runner(64)),
          'runner_without_test_library': ' '.join(
              get_nacl_runner(64, use_test_library=False)),
          # The target does not support Valgrind. Use nacl_runner.
          'valgrind_runner': ' '.join(get_nacl_runner(64)),
          'valgrind_runner_without_test_library': ' '.join(
              get_nacl_runner(64, use_test_library=False)),
          'ncval': os.path.join(_NACL_TOOLS_PATH, 'ncval'),
          'gdb': os.path.join(get_nacl_toolchain_path(), 'x86_64-nacl-gdb'),
          'irt': 'nacl_irt_x86_64.nexe',
          'deps': [_NACL_DEPS_PATH],
          'llvm_tblgen': build_common.get_build_path_for_executable(
              'llvm-tblgen', is_host=True),
          'clangxx': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-clang++'),
          'clang': os.path.join(_PNACL_BIN_PATH, 'x86_64-nacl-clang'),
      },
      'bare_metal_i686': {
          'cxx': os.getenv('TARGETCXX', 'g++-4.8'),
          'cc': os.getenv('TARGETCC', 'gcc-4.8'),
          'asm': os.getenv('TARGETCC', 'gcc-4.8'),
          'clangxx': os.path.join(_CLANG_BIN_DIR, 'clang++'),
          'clang': os.path.join(_CLANG_BIN_DIR, 'clang'),
          'ld': os.getenv('TARGETLD', 'g++-4.8'),
          'ar': os.getenv('TARGETAR', 'ar'),
          'nm': os.getenv('TARGETNM', 'nm'),
          'objcopy': os.getenv('TARGETOBJCOPY', 'objcopy'),
          'objdump': os.getenv('TARGETOBJDUMP', 'objdump'),
          'addr2line': os.getenv('TARGETADDR2LINE', 'addr2line'),
          'strip': os.getenv('TARGETSTRIP', 'strip'),
          'runner': ' '.join(get_bare_metal_runner('x86_32')),
          'runner_without_test_library': ' '.join(
              get_bare_metal_runner('x86_32', use_test_library=False)),
          'valgrind_runner': _get_valgrind_runner('bare_metal_i686',
                                                  nacl_arch='x86_32'),
          'valgrind_runner_without_test_library': _get_valgrind_runner(
              'bare_metal_i686', use_test_library=False, nacl_arch='x86_32'),
          'gdb': 'gdb',
          'deps': [],
          'llvm_tblgen': build_common.get_build_path_for_executable(
              'llvm-tblgen', is_host=True),
      },
      'bare_metal_arm': {
          'cxx': os.getenv('TARGETCXX', ' arm-linux-gnueabihf-g++'),
          'cc': os.getenv('TARGETCC', ' arm-linux-gnueabihf-gcc'),
          'asm': os.getenv('TARGETCC', ' arm-linux-gnueabihf-gcc'),
          'clangxx': os.path.join(_CLANG_BIN_DIR, 'clang++'),
          'clang': os.path.join(_CLANG_BIN_DIR, 'clang'),
          'clang.ld': os.path.join(_CLANG_BIN_DIR, 'clang'),
          'ld': os.getenv('TARGETLD', 'arm-linux-gnueabihf-g++'),
          'ar': os.getenv('TARGETAR', 'arm-linux-gnueabihf-ar'),
          'nm': os.getenv('TARGETNM', 'arm-linux-gnueabihf-nm'),
          'objcopy': os.getenv('TARGETOBJCOPY', 'arm-linux-gnueabihf-objcopy'),
          'objdump': os.getenv('TARGETOBJDUMP', 'arm-linux-gnueabihf-objdump'),
          'addr2line': os.getenv('TARGETADDR2LINE',
                                 'arm-linux-gnueabihf-addr2line'),
          'strip': os.getenv('TARGETSTRIP', 'arm-linux-gnueabihf-strip'),
          'runner': ' '.join(get_bare_metal_runner('arm', use_qemu_arm=True)),
          'runner_without_test_library': ' '.join(
              get_bare_metal_runner('arm', use_qemu_arm=True,
                                    use_test_library=False)),
          # We do not support valgrind on Bare Metal ARM.
          'valgrind_runner': ' '.join(get_bare_metal_runner(
              'arm', use_qemu_arm=True)),
          'valgrind_runner_without_test_library': ' '.join(
              get_bare_metal_runner(use_qemu_arm=True, use_test_library=False)),
          'gdb': build_common.get_gdb_multiarch_path(),
          'deps': [],
          'llvm_tblgen': build_common.get_build_path_for_executable(
              'llvm-tblgen', is_host=True),
      },
      'java': {
          'aapt': os.getenv(
              'AAPT', os.path.join(android_sdk_build_tools_dir, 'aapt')),
          'aidl': os.path.join(android_sdk_build_tools_dir, 'aidl'),
          'dx': os.getenv(
              'DX', os.path.join(android_sdk_build_tools_dir, 'dx')),
          'deps': [],
          'dex2oat': build_common.get_build_path_for_executable(
              'dex2oatd' if OPTIONS.is_debug_code_enabled() else 'dex2oat',
              is_host=True),
          'dexdump': os.path.join(android_sdk_build_tools_dir, 'dexdump'),
          'java-event-log-tags': os.path.join(android_build_tools_dir,
                                              'java-event-log-tags.py'),
          'jar': _get_java_command('jar'),
          'jarjar': os.getenv('JARJAR', os.path.join(
              _DEXMAKER_PATH, 'lib', 'jarjar.jar')),
          'java': _get_java_command('java'),
          'javac': _get_java_command('javac'),
          'runner': _get_native_runner('java'),
          'zipalign': os.path.join(android_sdk_build_tools_dir, 'zipalign'),
      },
  }
开发者ID:epowers,项目名称:arc,代码行数:104,代码来源:toolchain.py

示例8: build

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.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
# number of 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_ALL_CODENAMES'] = 'REL'
os.environ['PLATFORM_VERSION'] = '5.0'
# SDK has to be pinned to correct level to avoid loading
# unsupported featured from app's APK file.
os.environ['PLATFORM_SDK_VERSION'] = str(toolchain.get_android_api_level())

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


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