1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

tools/setup: avoid running gn gen twice in the same output directory

This commit is contained in:
Bert Belder 2018-07-31 11:19:02 +02:00
parent 446081b1e6
commit e5b7d31aba
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
2 changed files with 11 additions and 3 deletions

View file

@ -33,7 +33,7 @@ def get_gn_args():
# gn gen. # gn gen.
for mode in ["release", "debug"]: def gn_gen(mode):
os.environ["DENO_BUILD_MODE"] = mode os.environ["DENO_BUILD_MODE"] = mode
gn_args = get_gn_args() gn_args = get_gn_args()
@ -52,3 +52,11 @@ for mode in ["release", "debug"]:
run([third_party.gn_path, "gen", build_path()], run([third_party.gn_path, "gen", build_path()],
env=third_party.google_env()) env=third_party.google_env())
mode = build_mode(default=None)
if mode is not None:
gn_gen(mode)
else:
gn_gen("release")
gn_gen("debug")

View file

@ -103,11 +103,11 @@ def rmtree(directory):
shutil.rmtree(directory, onerror=rm_readonly) shutil.rmtree(directory, onerror=rm_readonly)
def build_mode(): def build_mode(default="debug"):
if "DENO_BUILD_MODE" in os.environ: if "DENO_BUILD_MODE" in os.environ:
return os.environ["DENO_BUILD_MODE"] return os.environ["DENO_BUILD_MODE"]
else: else:
return "debug" return default
# E.G. "out/debug" # E.G. "out/debug"