The '-optimize-size' option would enable the compiler to optimize
for size instead of speed. If the global compiler option already
included '-Os', this option would be enabled by default.

It would affect the whole Qt libraries and Qt applications as well.
This feature is available in Qt 5.9+.

Signed-off-by: Kwangsub Kim <kwangsub....@qt.io>
---
 recipes-qt/qt5/qtbase_git.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 4f3ade2..208a755 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -147,6 +147,9 @@ PACKAGECONFIG[widgets] = "-widgets,-no-widgets"
 PACKAGECONFIG[libproxy] = "-libproxy,-no-libproxy,libproxy"
 PACKAGECONFIG[libinput] = "-libinput,-no-libinput,libinput"
 PACKAGECONFIG[journald] = "-journald,-no-journald,systemd"
+PACKAGECONFIG[optimize-size] = 
"-optimize-size,${QT_DEFAULT_OPTIMIZATION_FOR_SIZE}"
+
+QT_DEFAULT_OPTIMIZATION_FOR_SIZE = 
"${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Os', '-optimize-size', '', d)}"
 
 QT_CONFIG_FLAGS_GOLD = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 
'-use-gold-linker', '-no-use-gold-linker', d)}"
 QT_CONFIG_FLAGS += " \
-- 
2.7.4

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to