From 05652346d5b15110fa214b740a152d310dc2adbe Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Sun, 22 Oct 2023 18:12:41 +0000 Subject: [PATCH] Specify '-optimize-size' only when building release binaries This is a follow up to my previous commit [1], which started specifying '-optimize-size' configure option for Qt6 for #822. It turns out that configure process may fail if '-optimize-size' is not specified with either '-release' or '-debug-and-release'. This commit takes care of such a limitation. [1]: 5757f28e1fd21dda58100ecf4a0f0c161c7120ce PiperOrigin-RevId: 575634660 --- src/build_tools/build_qt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build_tools/build_qt.py b/src/build_tools/build_qt.py index b3e7db769..f893699db 100755 --- a/src/build_tools/build_qt.py +++ b/src/build_tools/build_qt.py @@ -262,7 +262,6 @@ def make_configure_options(args: argparse.Namespace) -> list[str]: qt_configure_options = ['-opensource', '-c++std', 'c++20', - '-optimize-size', '-silent', '-no-cups', '-no-dbus', @@ -362,6 +361,9 @@ def make_configure_options(args: argparse.Namespace) -> list[str]: elif args.release: qt_configure_options += ['-release'] + if args.release: + qt_configure_options += ['-optimize-size'] + qt_src_dir = pathlib.Path(args.qt_src_dir).resolve() qt_dest_dir = pathlib.Path(args.qt_dest_dir).resolve() if qt_src_dir != qt_dest_dir: