コード例 #1
0
ファイル: build.py プロジェクト: Ankitvaibs/SM
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])

  for config in args.configuration:
    build_path = os.path.join('out', config[0])
    ret = subprocess.call([ninja, '-C', build_path, args.target])
    if ret != 0:
      sys.exit(ret)
コード例 #2
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)
コード例 #3
0
ファイル: build.py プロジェクト: 116356754/electron
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()
  for config in args.configuration:
    build_path = os.path.join('out', config[0])
    ret = subprocess.call([ninja, '-C', build_path, args.target])
    if ret != 0:
      sys.exit(ret)
コード例 #4
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()
    for config in args.configuration:
        build_path = os.path.join('out', config[0])
        ret = subprocess.call([ninja, '-C', build_path, args.target])
        if ret != 0:
            sys.exit(ret)
コード例 #5
0
def run_gyp(target_arch, component):
    # Update the VS build env.
    import_vs_env(target_arch)

    env = os.environ.copy()
    if PLATFORM == 'linux' and target_arch != get_host_arch():
        env['GYP_CROSSCOMPILE'] = '1'
    elif PLATFORM == 'win32':
        env['GYP_MSVS_VERSION'] = '2015'
    python = sys.executable
    if sys.platform == 'cygwin':
        # Force using win32 python on cygwin.
        python = os.path.join('vendor', 'python_26', 'python.exe')
    gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py')
    gyp_pylib = os.path.join(os.path.dirname(gyp), 'pylib')
    # Avoid using the old gyp lib in system.
    env['PYTHONPATH'] = os.path.pathsep.join(
        [gyp_pylib, env.get('PYTHONPATH', '')])
    # Whether to build for Mac App Store.
    if os.environ.has_key('MAS_BUILD'):
        mas_build = 1
    else:
        mas_build = 0

    defines = [
        '-Dlibchromiumcontent_component={0}'.format(component),
        '-Dtarget_arch={0}'.format(target_arch),
        '-Dhost_arch={0}'.format(get_host_arch()),
        '-Dlibrary=static_library',
        '-Dmas_build={0}'.format(mas_build),
    ]

    # Add the defines passed from command line.
    args = parse_args()
    for define in [d.strip() for d in args.defines.split(' ')]:
        if define:
            defines += ['-D' + define]

    generator = 'ninja'
    if args.msvs:
        generator = 'msvs-ninja'

    return subprocess.call([
        python, gyp, '-f', generator, '--depth', '.', 'electron.gyp',
        '-Icommon.gypi'
    ] + defines,
                           env=env)
コード例 #6
0
ファイル: update.py プロジェクト: nopenoway0/electron
def run_gyp(target_arch, component):
  # Update the VS build env.
  import_vs_env(target_arch)

  env = os.environ.copy()
  if PLATFORM == 'linux' and target_arch != get_host_arch():
    env['GYP_CROSSCOMPILE'] = '1'
  elif PLATFORM == 'win32':
    env['GYP_MSVS_VERSION'] = '2015'
  python = sys.executable
  if sys.platform == 'cygwin':
    # Force using win32 python on cygwin.
    python = os.path.join('vendor', 'python_26', 'python.exe')
  gyp = os.path.join('vendor', 'gyp', 'gyp_main.py')
  gyp_pylib = os.path.join(os.path.dirname(gyp), 'pylib')
  # Avoid using the old gyp lib in system.
  env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib,
                                            env.get('PYTHONPATH', '')])
  # Whether to build for Mac App Store.
  if os.environ.has_key('MAS_BUILD'):
    mas_build = 1
  else:
    mas_build = 0

  defines = [
    '-Dlibchromiumcontent_component={0}'.format(component),
    '-Dtarget_arch={0}'.format(target_arch),
    '-Dhost_arch={0}'.format(get_host_arch()),
    '-Dlibrary=static_library',
    '-Dmas_build={0}'.format(mas_build),
  ]

  # Add the defines passed from command line.
  args = parse_args()
  for define in [d.strip() for d in args.defines.split(' ')]:
    if define:
      defines += ['-D' + define]

  generator = 'ninja'
  if args.msvs:
    generator = 'msvs-ninja'
  elif args.xcode:
    generator = 'xcode-ninja'

  return subprocess.call([python, gyp, '-f', generator, '--depth', '.',
                          'electron.gyp', '-Icommon.gypi'] + defines, env=env)
コード例 #7
0
ファイル: build.py プロジェクト: HolmesNY/electron
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])
    ret = subprocess.call(ninja + ['-C', build_path, args.target], env=env)
    if ret != 0:
      sys.exit(ret)
コード例 #8
0
ファイル: update.py プロジェクト: CBaptiste/electron
def run_gyp(target_arch, component):
    # Update the VS build env.
    import_vs_env(target_arch)

    env = os.environ.copy()
    if PLATFORM == "linux" and target_arch != get_host_arch():
        env["GYP_CROSSCOMPILE"] = "1"
    elif PLATFORM == "win32":
        env["GYP_MSVS_VERSION"] = "2015"
    python = sys.executable
    if sys.platform == "cygwin":
        # Force using win32 python on cygwin.
        python = os.path.join("vendor", "python_26", "python.exe")
    gyp = os.path.join("vendor", "brightray", "vendor", "gyp", "gyp_main.py")
    gyp_pylib = os.path.join(os.path.dirname(gyp), "pylib")
    # Avoid using the old gyp lib in system.
    env["PYTHONPATH"] = os.path.pathsep.join([gyp_pylib, env.get("PYTHONPATH", "")])
    # Whether to build for Mac App Store.
    if os.environ.has_key("MAS_BUILD"):
        mas_build = 1
    else:
        mas_build = 0

    defines = [
        "-Dlibchromiumcontent_component={0}".format(component),
        "-Dtarget_arch={0}".format(target_arch),
        "-Dhost_arch={0}".format(get_host_arch()),
        "-Dlibrary=static_library",
        "-Dmas_build={0}".format(mas_build),
    ]

    # Add the defines passed from command line.
    args = parse_args()
    for define in [d.strip() for d in args.defines.split(" ")]:
        if define:
            defines += ["-D" + define]

    return subprocess.call(
        [python, gyp, "-f", "ninja", "--depth", ".", "electron.gyp", "-Icommon.gypi"] + defines, env=env
    )
コード例 #9
0
ファイル: build.py プロジェクト: go-meson/framework
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()
  for config in args.configuration:
    build_path = os.path.join('out', config[0])
    build_targets = BUILD_TARGETS[PLATFORM]
    if args.target != '':
        build_targets = [args.target]

    for build_target in build_targets:
      cmds = [ninja, '-C', build_path, build_target]
      if args.verbose:
        cmds.append('-v')
      ret = subprocess.call(cmds)
      if ret != 0:
        sys.exit(ret)