systemd/mkosi.clangd
Daan De Meyer 70af6703b0 mkosi: Set BuildSourcesEphemeral=no in mkosi.clangd
We're just running a language server so no need to put a writable
overlay on top of the build sources to prevent modifications. This
hopefully helps the language server track modifications to the source
files better.
2024-11-01 13:30:45 +01:00

22 lines
654 B
Bash
Executable File

#!/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 \
--build-sources-ephemeral=no \
--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" \
"$@"