Patrick Williams | 0bb89f8 | 2021-04-16 16:30:04 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | REPO_ROOT=$(git rev-parse --show-toplevel) |
| 4 | |
| 5 | # Find sdbus++-gen-meson |
| 6 | # 1. Check $SDBUSPP_GEN_MESON |
| 7 | # 2. Check in $PATH |
| 8 | # 3. Check in subprojects/sdbusplus |
| 9 | if [ ! -x "$SDBUSPP_GEN_MESON" ]; then |
| 10 | SDBUSPP_GEN_MESON="$(which sdbus++-gen-meson 2> /dev/null)" |
| 11 | fi |
| 12 | if [ ! -x "$SDBUSPP_GEN_MESON" ]; then |
| 13 | SDBUSPP_GEN_MESON="$REPO_ROOT/subprojects/sdbusplus/tools/sdbus++-gen-meson" |
| 14 | fi |
| 15 | if [ ! -x "$SDBUSPP_GEN_MESON" ]; then |
| 16 | echo "Cannot find sdbus++-gen-meson ($SDBUSPP_GEN_MESON)." |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | $SDBUSPP_GEN_MESON \ |
| 21 | --command meson \ |
| 22 | --directory "$REPO_ROOT" \ |
| 23 | --output "$REPO_ROOT/gen" |