Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))

Expand All @@ -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
Expand All @@ -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)
Expand Down