blob: 6c32c467ae33cd24aa1f7b46f4a1ea13f12b1c47 [file] [log] [blame]
#!/bin/bash
REPO_ROOT=$(git rev-parse --show-toplevel)
# Find sdbus++-gen-meson
# 1. Check $SDBUSPP_GEN_MESON
# 2. Check in $PATH
# 3. Check in subprojects/sdbusplus
if [ ! -x "$SDBUSPP_GEN_MESON" ]; then
SDBUSPP_GEN_MESON="$(which sdbus++-gen-meson 2> /dev/null)"
fi
if [ ! -x "$SDBUSPP_GEN_MESON" ]; then
SDBUSPP_GEN_MESON="$REPO_ROOT/subprojects/sdbusplus/tools/sdbus++-gen-meson"
fi
if [ ! -x "$SDBUSPP_GEN_MESON" ]; then
echo "Cannot find sdbus++-gen-meson ($SDBUSPP_GEN_MESON)."
exit 1
fi
$SDBUSPP_GEN_MESON \
--command meson \
--directory $REPO_ROOT \
--output $REPO_ROOT/gen