未验证 提交 a6105050 编写于 作者: D Dan Field 提交者: GitHub

option for --no-lto for fuchsia (#12010)

上级 be398209
......@@ -52,6 +52,8 @@ def RunExecutable(command):
def RunGN(variant_dir, flags):
print('Running gn for variant "%s" with flags: %s' % (variant_dir,
','.join(flags)))
RunExecutable([
os.path.join('flutter', 'tools', 'gn'),
] + flags)
......@@ -192,16 +194,19 @@ def GetTargetsToBuild(product=False):
return targets_to_build
def BuildTarget(runtime_mode, arch, product):
def BuildTarget(runtime_mode, arch, product, enable_lto):
out_dir = 'fuchsia_%s_%s' % (runtime_mode, arch)
flags = [
'--fuchsia',
'--fuchsia-cpu',
arch,
'--runtime-mode',
runtime_mode
runtime_mode,
]
if not enable_lto:
flags.append('--no-lto')
RunGN(out_dir, flags)
BuildNinjaTargets(out_dir, GetTargetsToBuild(product))
......@@ -228,6 +233,12 @@ def main():
choices=['debug', 'profile', 'release', 'all'],
default='all')
parser.add_argument(
'--no-lto',
action='store_true',
default=False,
help='If set, disables LTO for the build.')
args = parser.parse_args()
RemoveDirectoryIfExists(_bucket_directory)
build_mode = args.runtime_mode
......@@ -236,12 +247,14 @@ def main():
runtime_modes = ['debug', 'profile', 'release']
product_modes = [False, False, True]
enable_lto = not args.no_lto
for arch in archs:
for i in range(3):
runtime_mode = runtime_modes[i]
product = product_modes[i]
if build_mode == 'all' or runtime_mode == build_mode:
BuildTarget(runtime_mode, arch, product)
BuildTarget(runtime_mode, arch, product, enable_lto)
BuildBucket(runtime_mode, arch, product)
ProcessCIPDPakcage(args.upload, args.engine_version)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册