Ejemplo n.º 1
0
def main():
    os.chdir(SOURCE_ROOT)

    # Update the VS build env.
    import_vs_env(get_target_arch())

    ninja = os.path.join('vendor', 'depot_tools', 'ninja')
    if sys.platform == 'win32':
        ninja += '.exe'

    args = parse_args()
    if args.libcc:
        if ('D' not in args.configuration or not os.path.exists(GCLIENT_DONE)
                or not os.path.exists(
                    os.path.join(LIBCC_DIST_MAIN, 'build.ninja'))):
            sys.stderr.write(
                '--libcc should only be used when '
                'libchromiumcontent was built with bootstrap.py -d '
                '--debug_libchromiumcontent' + os.linesep)
            sys.exit(1)
        script = os.path.join(LIBCC_SOURCE_ROOT, 'script', 'build')
        subprocess.check_call(
            [sys.executable, script, '-D', '-t',
             get_target_arch()])
        subprocess.check_call([ninja, '-C', LIBCC_DIST_MAIN])

    env = build_env()
    for config in args.configuration:
        build_path = os.path.join('out', config[0])
        ret = subprocess.call([ninja, '-C', build_path, args.target], env=env)
        if ret != 0:
            sys.exit(ret)
Ejemplo n.º 2
0
def main():
  os.chdir(SOURCE_ROOT)

  # Update the VS build env.
  import_vs_env(get_target_arch())

  ninja = os.path.join('vendor', 'depot_tools', 'ninja')
  if sys.platform == 'win32':
    ninja += '.exe'

  args = parse_args()
  if args.libcc:
    if ('D' not in args.configuration
        or not os.path.exists(GCLIENT_DONE)
        or not os.path.exists(os.path.join(LIBCC_DIST_MAIN, 'build.ninja'))):
      sys.stderr.write('--libcc should only be used when '
                       'libchromiumcontent was built with bootstrap.py -d '
                       '--debug_libchromiumcontent' + os.linesep)
      sys.exit(1)
    script = os.path.join(LIBCC_SOURCE_ROOT, 'script', 'build')
    subprocess.check_call([sys.executable, script, '-D', '-t',
                           get_target_arch()])
    subprocess.check_call([ninja, '-C', LIBCC_DIST_MAIN])

  env = build_env()
  for config in args.configuration:
    build_path = os.path.join('out', config[0])
    ret = subprocess.call([ninja, '-C', build_path, args.target], env=env)
    if ret != 0:
      sys.exit(ret)
Ejemplo n.º 3
0
def strip_binary(binary_path):
  if get_target_arch() == 'arm':
    strip = 'arm-linux-gnueabihf-strip'
  elif get_target_arch() == 'arm64':
    strip = 'aarch64-linux-gnu-strip'
  elif get_target_arch() == 'mips64el':
    strip = 'mips64el-redhat-linux-strip'
  else:
    strip = 'strip'
  execute([strip, binary_path], env=build_env())
Ejemplo n.º 4
0
def strip_binary(binary_path):
    if get_target_arch() == 'arm':
        strip = 'arm-linux-gnueabihf-strip'
    elif get_target_arch() == 'arm64':
        strip = 'aarch64-linux-gnu-strip'
    elif get_target_arch() == 'mips64el':
        strip = 'mips64el-redhat-linux-strip'
    else:
        strip = 'strip'
    execute([strip, binary_path], env=build_env())
Ejemplo n.º 5
0
def main():
  os.chdir(SOURCE_ROOT)

  args = parse_args()
  if args.verbose:
    enable_verbose_mode()

  # Update the VS build env.
  import_vs_env(get_target_arch())

  # decide which ninja executable to use
  ninja_path = args.ninja_path
  if not ninja_path:
    ninja_path = os.path.join('vendor', 'depot_tools', 'ninja')
    if sys.platform == 'win32':
      ninja_path += '.exe'

  # decide how to invoke ninja
  ninja = [ninja_path]
  if is_verbose_mode():
    ninja.append('-v')

  if args.libcc:
    if ('D' not in args.configuration
        or not os.path.exists(GCLIENT_DONE)
        or not os.path.exists(os.path.join(LIBCC_DIST_MAIN, 'build.ninja'))):
      sys.stderr.write('--libcc should only be used when '
                       'libchromiumcontent was built with bootstrap.py -d '
                       '--debug_libchromiumcontent' + os.linesep)
      sys.exit(1)
    script = os.path.join(LIBCC_SOURCE_ROOT, 'script', 'build')
    subprocess.check_call([sys.executable, script, '-D', '-t',
                           get_target_arch()])
    subprocess.check_call(ninja + ['-C', LIBCC_DIST_MAIN])

  env = build_env()
  for config in args.configuration:
    build_path = os.path.join('out', config[0])
    build_args = ['-C', build_path, args.target]
    if args.compdb:
      build_args += ['-t', 'compdb', 'cxx', 'cc']
      compdb = open(r'compile_commands.json','w')
      ret = subprocess.call(ninja + build_args, env=env, stdout=compdb)
      compdb.close()
    else:
      ret = subprocess.call(ninja + build_args, env=env)
    if ret != 0:
      sys.exit(ret)