From 6d862a9dc08285fffb9da29055235b5c9935dcf8 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 21 Sep 2024 19:29:15 +0200 Subject: mkosi: Add back support for running clangd within mkosi This allows hacking on systemd without installing any build dependencies except mkosi on the host machine. --- mkosi.clangd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 mkosi.clangd (limited to 'mkosi.clangd') diff --git a/mkosi.clangd b/mkosi.clangd new file mode 100755 index 0000000000..80d544677a --- /dev/null +++ b/mkosi.clangd @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: LGPL-2.1-or-later + +MKOSI_CONFIG="$(mkosi --json summary | jq -r .Images[-1])" +DISTRIBUTION="$(jq -r .Distribution <<< "$MKOSI_CONFIG")" +RELEASE="$(jq -r .Release <<< "$MKOSI_CONFIG")" +ARCH="$(jq -r .Architecture <<< "$MKOSI_CONFIG")" + +exec mkosi \ + --incremental=strict \ + --format=none \ + build \ + clangd \ + --compile-commands-dir=/work/build \ + --path-mappings="\ +$(pwd)=/work/src,\ +$(pwd)/build/mkosi.builddir/$DISTRIBUTION~$RELEASE~$ARCH/=/work/build,\ +$(pwd)/build/mkosi.cache/$DISTRIBUTION~$RELEASE~$ARCH~build.cache/usr/include/=/usr/include" \ + "$@" + -- cgit v1.2.3