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:
parent
446081b1e6
commit
e5b7d31aba
2 changed files with 11 additions and 3 deletions
|
@ -33,7 +33,7 @@ def get_gn_args():
|
|||
|
||||
|
||||
# gn gen.
|
||||
for mode in ["release", "debug"]:
|
||||
def gn_gen(mode):
|
||||
os.environ["DENO_BUILD_MODE"] = mode
|
||||
|
||||
gn_args = get_gn_args()
|
||||
|
@ -52,3 +52,11 @@ for mode in ["release", "debug"]:
|
|||
|
||||
run([third_party.gn_path, "gen", build_path()],
|
||||
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")
|
||||
|
|
|
@ -103,11 +103,11 @@ def rmtree(directory):
|
|||
shutil.rmtree(directory, onerror=rm_readonly)
|
||||
|
||||
|
||||
def build_mode():
|
||||
def build_mode(default="debug"):
|
||||
if "DENO_BUILD_MODE" in os.environ:
|
||||
return os.environ["DENO_BUILD_MODE"]
|
||||
else:
|
||||
return "debug"
|
||||
return default
|
||||
|
||||
|
||||
# E.G. "out/debug"
|
||||
|
|
Loading…
Reference in a new issue