summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraprospero <apro@posteo.de>2025-03-17 14:12:53 +0100
committerKhem Raj <raj.khem@gmail.com>2025-03-17 18:38:34 -0700
commitd5b9fdbed63f55882d46b104ed0234a7de4d35a4 (patch)
tree576d500d099150c5a28a50b94e23fb5fbebd6e37
parent3669c28e90ad710e38ad2381ef0292d706fa9ffd (diff)
downloadmeta-clang-d5b9fdbed63f55882d46b104ed0234a7de4d35a4.tar.gz
fix: [Issue #1061] - check for existence before trying to process a file
In certain configurations LLVMConfig.cmake does not exist. If that's the case do_install breaks for the nativesdk-clang recipe. Eg. set the following: EXTRA_OECMAKE:append:pn-nativesdk-clang = " -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON" as suggested here: https://llvm.org/docs/BuildingADistribution.html Signed-off-by: aprospero <apro@posteo.de>
-rw-r--r--recipes-devtools/clang/clang_git.bb8
1 files changed, 6 insertions, 2 deletions
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 5017895..b5e94b5 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -284,7 +284,9 @@ do_install:append:class-native () {
284} 284}
285 285
286do_install:append:class-nativesdk () { 286do_install:append:class-nativesdk () {
287 sed -i -e "s|${B}/./bin/||g" ${D}${libdir}/cmake/llvm/LLVMConfig.cmake 287 if [ -e ${D}${libdir}/cmake/llvm/LLVMConfig.cmake ] ; then
288 sed -i -e "s|${B}/./bin/||g" ${D}${libdir}/cmake/llvm/LLVMConfig.cmake
289 fi
288 if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then 290 if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then
289 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer 291 install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer
290 fi 292 fi
@@ -300,7 +302,9 @@ do_install:append:class-nativesdk () {
300 rm -rf ${D}${datadir}/llvm 302 rm -rf ${D}${datadir}/llvm
301 303
302 #reproducibility 304 #reproducibility
303 sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake 305 if [ -e ${D}${libdir}/cmake/llvm/LLVMConfig.cmake ] ; then
306 sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake
307 fi
304} 308}
305 309
306PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ 310PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \