tools: Don't write args.gn if unchanged (see #3681, see #3685)

Now that args.gn is an input to the make_config_header target we
don't want to invalidate the build unnecessarily by modifying the
file if the contents are unchanged.
This commit is contained in:
Marshall Greenblatt 2024-05-03 15:33:38 -04:00
parent 17a1fd62ec
commit 002f4b5b4a

View File

@ -5,7 +5,7 @@
from __future__ import absolute_import
from __future__ import print_function
from file_util import make_dir, write_file
from file_util import make_dir, write_file_if_changed
from gclient_util import *
from gn_args import GetAllPlatformConfigs, GetConfigFileContents
import issue_1999
@ -140,7 +140,7 @@ for dir, config in configs.items():
make_dir(out_path, False)
args_gn_path = os.path.join(out_path, 'args.gn')
args_gn_contents = GetConfigFileContents(config)
write_file(args_gn_path, args_gn_contents)
write_file_if_changed(args_gn_path, args_gn_contents)
# Generate the Ninja config.
cmd = ['gn', 'gen', os.path.join('out', dir)]