diff options
author | Kai Kang <kai.kang@windriver.com> | 2021-04-23 11:29:03 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2021-04-26 08:58:08 +0800 |
commit | db6a315e5f6de02e226e582f878a83c427fd87cc (patch) | |
tree | 7a0189672f752dcc34c6e8fe85505346fc946a47 /meta/classes | |
parent | 51b03665de86c14f5b3887a60154b118c0d37aa3 (diff) | |
download | openembedded-core-contrib-db6a315e5f6de02e226e582f878a83c427fd87cc.tar.gz |
cmake.bbclass: remove ${B} before cmake_do_configure
It is fallible to remove ${B} in directory ${B} itself. And it does fail
when call bitbake by third-party wrapper script.
Use flag 'cleandirs' to remove ${B} first if build out of source tree.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0fb6280432a36985590d9a714a5f11164aaebb51)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/cmake.bbclass | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index 8876ce5aa5..f01db7480b 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -149,16 +149,14 @@ addtask generate_toolchain_file after do_patch before do_configure CONFIGURE_FILES = "CMakeLists.txt" +do_configure[cleandirs] = "${@d.getVar('B') if d.getVar('S') != d.getVar('B') else ''}" + cmake_do_configure() { if [ "${OECMAKE_BUILDPATH}" ]; then bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build." fi - if [ "${S}" != "${B}" ]; then - rm -rf ${B} - mkdir -p ${B} - cd ${B} - else + if [ "${S}" = "${B}" ]; then find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete fi |