blob: a39ad640c9f9b7524504f92424a1091b7930c18e [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/yaml" \
--output "$REPO_ROOT/gen"