[oe] [meta-qt5][PATCH v3] qtbase: add a config option to optimize for size

Kwangsub Kim kwangsub.kim at qt.io
Tue Feb 20 12:04:33 UTC 2018


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.kim at qt.io>
---
 recipes-qt/qt5/qtbase_git.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 4f3ade2..85a2e0d 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -73,6 +73,7 @@ PACKAGECONFIG_RELEASE ?= "release"
 # This is in qt5.inc, because qtwebkit-examples are using it to enable ca-certificates dependency
 # PACKAGECONFIG_OPENSSL ?= "openssl"
 PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs freetype tests"
+PACKAGECONFIG_DEFAULT += "${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Os', 'optimize-size', '', d)}"
 
 PACKAGECONFIG ?= " \
     ${PACKAGECONFIG_RELEASE} \
@@ -90,6 +91,7 @@ PACKAGECONFIG[release] = "-release,-debug"
 PACKAGECONFIG[debug] = ""
 PACKAGECONFIG[developer] = "-developer-build"
 PACKAGECONFIG[qml-debug] = "-qml-debug,-no-qml-debug"
+PACKAGECONFIG[optimize-size] = "-optimize-size"
 PACKAGECONFIG[sm] = "-sm,-no-sm"
 PACKAGECONFIG[tests] = "-make tests,-nomake tests"
 PACKAGECONFIG[examples] = "-make examples -compile-examples,-nomake examples"
-- 
2.7.4




More information about the Openembedded-devel mailing list