예제 #1
0
def generate_gn_args(mode):
    out = []
    if mode == "release":
        out += ["is_official_build=true"]
    elif mode == "debug":
        # Enable Jumbo build by default in debug mode for faster build.
        # https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md
        out += ["use_jumbo_build=true"]
    else:
        print "Bad mode {}. Use 'release' or 'debug' (default)" % mode
        sys.exit(1)

    if "DENO_BUILD_ARGS" in os.environ:
        out += os.environ["DENO_BUILD_ARGS"].split()

    # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
    cc_wrapper = find_executable("ccache") or find_executable("sccache")
    if cc_wrapper:
        # The gn toolchain does not shell escape cc_wrapper, so do it here.
        out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
        if os.name == "nt":
            # Disable treat_warnings_as_errors until this sccache bug is fixed:
            # https://github.com/mozilla/sccache/issues/264
            out += ["treat_warnings_as_errors=false"]

    # Look for sccache; if found, set rustc_wrapper.
    rustc_wrapper = find_executable("sccache")
    if rustc_wrapper:
        out += ['rustc_wrapper=%s' % gn_string(rustc_wrapper)]

    return out
예제 #2
0
파일: setup.py 프로젝트: yulintianxia/deno
def generate_gn_args(mode):
    out = []
    if mode == "release":
        out += ["is_official_build=true", "symbol_level=0"]
    elif mode == "debug":
        out += ["is_debug=true"]
    else:
        print "Bad mode {}. Use 'release' or 'debug' (default)" % mode
        sys.exit(1)

    if "DENO_BUILD_ARGS" in os.environ:
        out += os.environ["DENO_BUILD_ARGS"].split()

    cacher = find_executable("sccache")
    if not os.path.exists(cacher):
        cacher = third_party.get_prebuilt_tool_path("sccache")

    # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
    cc_wrapper = cacher
    if cc_wrapper:
        # The gn toolchain does not shell escape cc_wrapper, so do it here.
        out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
        if os.name == "nt":
            # Disable treat_warnings_as_errors until this sccache bug is fixed:
            # https://github.com/mozilla/sccache/issues/264
            out += ["treat_warnings_as_errors=false"]

    return out
예제 #3
0
def generate_gn_args(mode):
    out = []
    if mode == "release":
        out += ["is_official_build=true"]
    elif mode == "debug":
        pass
    else:
        print "Bad mode {}. Use 'release' or 'debug' (default)" % mode
        sys.exit(1)

    if "DENO_BUILD_ARGS" in os.environ:
        out += os.environ["DENO_BUILD_ARGS"].split()

    # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
    cc_wrapper = find_executable("ccache") or find_executable("sccache")
    if cc_wrapper:
        # The gn toolchain does not shell escape cc_wrapper, so do it here.
        out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
        # For cc_wrapper to work on Windows, we need to select our own toolchain
        # by overriding 'custom_toolchain' and 'host_toolchain'.
        # TODO: Is there a way to use it without the involvement of args.gn?
        if os.name == "nt":
            tc = "//build_extra/toolchain/win:win_clang_x64"
            out += ['custom_toolchain="%s"' % tc, 'host_toolchain="%s"' % tc]

    # Look for sccache; if found, set rustc_wrapper.
    rustc_wrapper = find_executable("sccache")
    if rustc_wrapper:
        out += ['rustc_wrapper=%s' % gn_string(rustc_wrapper)]

    return out
예제 #4
0
파일: setup.py 프로젝트: F001/deno
def generate_gn_args(mode):
    out = []
    if mode == "release":
        out += ["is_official_build=true"]
    elif mode == "debug":
        out += ["is_debug=true"]
    else:
        print "Bad mode {}. Use 'release' or 'debug' (default)" % mode
        sys.exit(1)

    if "DENO_BUILD_ARGS" in os.environ:
        out += os.environ["DENO_BUILD_ARGS"].split()

    cacher = prebuilt.load_sccache()
    if not os.path.exists(cacher):
        cacher = find_executable("sccache") or find_executable("ccache")

    # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
    cc_wrapper = cacher
    if cc_wrapper:
        # The gn toolchain does not shell escape cc_wrapper, so do it here.
        out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
        if os.name == "nt":
            # Disable treat_warnings_as_errors until this sccache bug is fixed:
            # https://github.com/mozilla/sccache/issues/264
            out += ["treat_warnings_as_errors=false"]

    # Look for sccache; if found, set rustc_wrapper.
    rustc_wrapper = cacher
    if rustc_wrapper:
        out += ['rustc_wrapper=%s' % gn_string(rustc_wrapper)]

    return out
예제 #5
0
파일: setup.py 프로젝트: xxoojs/deno
def generate_gn_args(mode):
    out = []
    if mode == "release":
        out += ["is_official_build=true"]
    elif mode == "debug":
        # Enable Jumbo build by default in debug mode for faster build.
        # https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md
        out += ["use_jumbo_build=true"]
    else:
        print "Bad mode {}. Use 'release' or 'debug' (default)" % mode
        sys.exit(1)

    if "DENO_BUILD_ARGS" in os.environ:
        out += os.environ["DENO_BUILD_ARGS"].split()

    # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
    cc_wrapper = find_executable("ccache") or find_executable("sccache")
    if cc_wrapper:
        # The gn toolchain does not shell escape cc_wrapper, so do it here.
        out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
        # For cc_wrapper to work on Windows, we need to select our own toolchain
        # by overriding 'custom_toolchain' and 'host_toolchain'.
        # TODO: Is there a way to use it without the involvement of args.gn?
        if os.name == "nt":
            tc = "//build_extra/toolchain/win:win_clang_x64"
            out += ['custom_toolchain="%s"' % tc, 'host_toolchain="%s"' % tc]
            # Disable treat_warnings_as_errors until this sccache bug is fixed:
            # https://github.com/mozilla/sccache/issues/264
            out += ["treat_warnings_as_errors=false"]

    # Look for sccache; if found, set rustc_wrapper.
    rustc_wrapper = find_executable("sccache")
    if rustc_wrapper:
        out += ['rustc_wrapper=%s' % gn_string(rustc_wrapper)]

    return out