forked from firka/flutter
option for --no-lto for fuchsia (flutter/engine#12010)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user