Some checks failed
odin-ci / build-test (push) Has been cancelled
add to gitignore
39 lines
919 B
Bash
Executable File
39 lines
919 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
CLAY_DIR="$SCRIPT_DIR/vendor/clay/bindings/odin/clay-odin"
|
|
BUILD_DIR="$SCRIPT_DIR/build"
|
|
|
|
ensure_clay_submodule() {
|
|
if [ -d "$CLAY_DIR" ]; then
|
|
return 0
|
|
fi
|
|
|
|
echo "Clay bindings not found at: $CLAY_DIR"
|
|
echo "Attempting to initialize git submodules..."
|
|
|
|
if command -v git >/dev/null 2>&1; then
|
|
git -C "$REPO_ROOT" submodule update --init --recursive odin/vendor/clay odin/vendor/osdialog || true
|
|
fi
|
|
|
|
if [ ! -d "$CLAY_DIR" ]; then
|
|
echo "error: clay submodule is missing. Run: git submodule update --init --recursive" >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
ensure_clay_submodule
|
|
|
|
# Build C dependencies
|
|
"$SCRIPT_DIR/build_osdialog.sh"
|
|
|
|
mkdir -p bin
|
|
|
|
odin build src/app \
|
|
-out:bin/comic_odin \
|
|
-debug \
|
|
-collection:clay="$CLAY_DIR" \
|
|
-extra-linker-flags:"-L$BUILD_DIR -losdialog"
|