summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2021-04-23 11:29:03 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-24 17:53:05 +0100
commit9bbd9cab86762e78afca0af0042720e0ea020279 (patch)
treefe0ae67360f5641d7f96189b16182e2b60d9da83
parentd2c176d1ca053833c84bea3041ef0f966d7c7b0d (diff)
downloadpoky-9bbd9cab86762e78afca0af0042720e0ea020279.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. (From OE-Core rev: 0fb6280432a36985590d9a714a5f11164aaebb51) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/cmake.bbclass8
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
149 149
150CONFIGURE_FILES = "CMakeLists.txt" 150CONFIGURE_FILES = "CMakeLists.txt"
151 151
152do_configure[cleandirs] = "${@d.getVar('B') if d.getVar('S') != d.getVar('B') else ''}"
153
152cmake_do_configure() { 154cmake_do_configure() {
153 if [ "${OECMAKE_BUILDPATH}" ]; then 155 if [ "${OECMAKE_BUILDPATH}" ]; then
154 bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build." 156 bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
155 fi 157 fi
156 158
157 if [ "${S}" != "${B}" ]; then 159 if [ "${S}" = "${B}" ]; then
158 rm -rf ${B}
159 mkdir -p ${B}
160 cd ${B}
161 else
162 find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete 160 find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete
163 fi 161 fi
164 162