Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
niranjanyardi committed Nov 15, 2024
1 parent ea63900 commit 9e33a69
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cobalt/build/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,15 @@ def main(out_directory: str, platform: str, build_type: str,
Path(out_directory).mkdir(parents=True, exist_ok=True)

build_args = get_build_args(src_args_gn_file)
if not os.path.exists(dst_args_gn_file):
write_build_args(dst_args_gn_file, build_args[0], build_args[1], build_type)
else:
# Overwrite args.gn, copy the stale args.gn file to stale_args.gn
if os.path.exists(dst_args_gn_file):
# Copy the stale args.gn into stale_args.gn
stale_dst_args_gn_file = dst_args_gn_file.replace('args', 'stale_args')
os.rename(dst_args_gn_file, stale_dst_args_gn_file)
print(f' Warning: {dst_args_gn_file} is rewritten.' +
' Old file is copied to {stale_dst_args_gn_file}.' +
'In general, if the file exists, you should run' +
' `gn args <out_directory>` to edit it instead.')
write_build_args(dst_args_gn_file, build_args[0], build_args[1], build_type)

write_build_args(dst_args_gn_file, build_args[0], build_args[1], build_type)
gn_command = ['gn', 'gen', out_directory] + gn_gen_args
print(' '.join(gn_command))
subprocess.check_call(gn_command)
Expand Down

0 comments on commit 9e33a69

Please sign in to comment.