diff options
| author | Philip Lorenz <philip.lorenz@bmw.de> | 2024-02-12 13:24:18 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-02-15 10:17:01 -0800 |
| commit | ca26df08948d2d904641c35f6b1b4b289f0d9eac (patch) | |
| tree | 240e3e4614149e550b41da397dd1ad4f3d7c3a7f /recipes-devtools | |
| parent | 5a79141ff12bbd245de6c7024431bd2b8eae93a9 (diff) | |
| download | meta-clang-ca26df08948d2d904641c35f6b1b4b289f0d9eac.tar.gz | |
clang: Allow conditional compilation of clangd
clangd should not be needed in target builds. Extend PACKAGECONFIG to
enable selective disabling and disable it by default for target builds.
Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Diffstat (limited to 'recipes-devtools')
| -rw-r--r-- | recipes-devtools/clang/clang_git.bb | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 7cb1c58..7384558 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
| @@ -63,12 +63,16 @@ PACKAGECONFIG ??= "compiler-rt libcplusplus lldb-wchar terminfo \ | |||
| 63 | ${PACKAGECONFIG_CLANG_COMMON} \ | 63 | ${PACKAGECONFIG_CLANG_COMMON} \ |
| 64 | ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ | 64 | ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ |
| 65 | " | 65 | " |
| 66 | PACKAGECONFIG:class-native = "${PACKAGECONFIG_CLANG_COMMON}" | 66 | PACKAGECONFIG:class-native = "clangd \ |
| 67 | PACKAGECONFIG:class-nativesdk = "${PACKAGECONFIG_CLANG_COMMON} \ | 67 | ${PACKAGECONFIG_CLANG_COMMON} \ |
| 68 | " | ||
| 69 | PACKAGECONFIG:class-nativesdk = "clangd \ | ||
| 70 | ${PACKAGECONFIG_CLANG_COMMON} \ | ||
| 68 | ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ | 71 | ${@bb.utils.filter('DISTRO_FEATURES', 'lto thin-lto', d)} \ |
| 69 | " | 72 | " |
| 70 | 73 | ||
| 71 | PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," | 74 | PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," |
| 75 | PACKAGECONFIG[clangd] = "-DCLANG_ENABLE_CLANGD=ON,-DCLANG_ENABLE_CLANGD=OFF,," | ||
| 72 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," | 76 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," |
| 73 | PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," | 77 | PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," |
| 74 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," | 78 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," |
| @@ -243,7 +247,9 @@ endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake | |||
| 243 | } | 247 | } |
| 244 | 248 | ||
| 245 | do_install:append:class-native () { | 249 | do_install:append:class-native () { |
| 246 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer | 250 | if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then |
| 251 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer | ||
| 252 | fi | ||
| 247 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen | 253 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen |
| 248 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen | 254 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen |
| 249 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen | 255 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen |
| @@ -260,7 +266,9 @@ do_install:append:class-native () { | |||
| 260 | 266 | ||
| 261 | do_install:append:class-nativesdk () { | 267 | do_install:append:class-nativesdk () { |
| 262 | sed -i -e "s|${B}/./bin/||g" ${D}${libdir}/cmake/llvm/LLVMConfig.cmake | 268 | sed -i -e "s|${B}/./bin/||g" ${D}${libdir}/cmake/llvm/LLVMConfig.cmake |
| 263 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer | 269 | if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then |
| 270 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer | ||
| 271 | fi | ||
| 264 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen | 272 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen |
| 265 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen | 273 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen |
| 266 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen | 274 | install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen |
| @@ -425,11 +433,18 @@ clang_sysroot_preprocess() { | |||
| 425 | ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} | 433 | ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} |
| 426 | # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to | 434 | # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to |
| 427 | install -d ${SYSROOT_DESTDIR}${bindir} | 435 | install -d ${SYSROOT_DESTDIR}${bindir} |
| 428 | for f in lld diagtool clang-${MAJOR_VER} clang-format clang-offload-packager \ | 436 | |
| 429 | clang-offload-bundler clang-scan-deps clang-repl \ | 437 | binaries="lld diagtool clang-${MAJOR_VER} clang-format clang-offload-packager |
| 430 | clang-rename clang-refactor clang-check clang-extdef-mapping clang-apply-replacements \ | 438 | clang-offload-bundler clang-scan-deps clang-repl |
| 431 | clang-reorder-fields clang-tidy clang-change-namespace clang-doc clang-include-fixer \ | 439 | clang-rename clang-refactor clang-check clang-extdef-mapping clang-apply-replacements |
| 432 | find-all-symbols clang-move clang-query pp-trace clang-pseudo clangd modularize | 440 | clang-reorder-fields clang-tidy clang-change-namespace clang-doc clang-include-fixer |
| 441 | find-all-symbols clang-move clang-query pp-trace clang-pseudo modularize" | ||
| 442 | |||
| 443 | if ${@bb.utils.contains('PACKAGECONFIG', 'clangd', 'true', 'false', d)}; then | ||
| 444 | binaries="${binaries} clangd" | ||
| 445 | fi | ||
| 446 | |||
| 447 | for f in ${binaries} | ||
| 433 | do | 448 | do |
| 434 | install -m 755 ${D}${bindir}/$f ${SYSROOT_DESTDIR}${bindir}/ | 449 | install -m 755 ${D}${bindir}/$f ${SYSROOT_DESTDIR}${bindir}/ |
| 435 | done | 450 | done |
