Skip to content

Commit

Permalink
Specify '-optimize-size' only when building release binaries
Browse files Browse the repository at this point in the history
This is a follow up to my previous commit [1], which started specifying
'-optimize-size' configure option for Qt6 for google#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]: 5757f28

PiperOrigin-RevId: 575634660
  • Loading branch information
yukawa authored and coooooooozy committed Nov 25, 2023
1 parent 4af9688 commit 8da710a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/build_tools/build_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8da710a

Please sign in to comment.