diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2013-05-08 22:40:30 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-05-09 13:56:49 +0200 |
commit | 7caede7850d7b33011a5a0e3124180db2f7a0d6c (patch) | |
tree | 75e504c15ac33e38fb7ad58135e04662ecf25163 /classes | |
parent | 56d2c7f18d5058a168df01d6a4797514a0f958b6 (diff) |
qmake5: Fix cleaning separate build directory and use it by default
* "${B}/*" in quotes doesn't match anything, better to remove whole directory
(incluing .files) and recreate it
* not sure why I've added quotes after testing first version, we don't
expect B with spaces.. but I'm a bit scared with rm -rf ${SOME_VAR}
after one glibc upgrade cleaned my whole disk and attached NFS array
when OLD_LOCALE_PATH wasn't detected correctly...
* qmake works well with separate B, use it by default
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/qmake5_base.bbclass | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass index 9aeafd70..0bfacec3 100644 --- a/classes/qmake5_base.bbclass +++ b/classes/qmake5_base.bbclass @@ -124,6 +124,33 @@ EOF # TargetSpec The location where to install target mkspec # HostSpec The location where to install host mkspec +# qmake works fine with separate B, use it by default +SEPB = "${WORKDIR}/build" +B = "${SEPB}" + +CONFIGURESTAMPFILE = "${WORKDIR}/qmake5_base_configure.sstate" + +qmake5_base_preconfigure() { + if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then + if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then + echo "Previously configured separate build directory detected, cleaning ${B}" + rm -rf ${B} + mkdir ${B} + fi + fi +} + +qmake5_base_postconfigure(){ + if [ -n "${CONFIGURESTAMPFILE}" ]; then + echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE} + fi +} + +EXTRAQCONFFUNCS ??= "" + +do_configure[prefuncs] += "qmake5_base_preconfigure ${EXTRAQCONFFUNCS}" +do_configure[postfuncs] += "qmake5_base_postconfigure" + addtask generate_qt_config_file after do_patch before do_configure qmake5_base_do_configure () { |