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
def main(): enable_ansi_colors() os.chdir(root_path) args = parser.parse_args() if args.no_binary_download: print "no binary download" else: print "binary download" third_party.download_gn() third_party.download_clang_format() third_party.download_clang() third_party.maybe_download_sysroot() prebuilt.load_sccache() write_lastchange() mode = build_mode(default=None) if mode is not None: gn_gen(mode) else: gn_gen("release") gn_gen("debug")