Files
2026-11-03 20:29:35 +07:00

38 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Сборка Xenith: CLI (bin/Xenith) + python-модуль (build/xenith_engine*.so).
# Использование: ./build.sh [--no-vulkan] [--debug]
set -e
VK=ON
BT=Release
for a in "$@"; do
case "$a" in
--no-vulkan) VK=OFF ;;
--debug) BT=Debug ;;
esac
done
# 1) шейдеры: GLSL → SPIR-V → xenith/backend/shaders_bin.h
if command -v Build_Shaders >/dev/null 2>&1; then Build_Shaders; else python3 tools/build_shaders.py; fi
# 2) конфигурация и сборка
cmake -B build -DXENITH_VULKAN=$VK -DCMAKE_BUILD_TYPE=$BT
cmake --build build -j
# 3) python-модуль кладётся в build/; заглушки типов — xenith/stubs/xenith_engine.pyi
# (пишутся вручную по python_bindings.cpp — stubgen их НЕ перезаписывает)
cat <<HINTS
готово:
bin/Xenith — CLI
build/xenith_engine*.so — python-модуль
проверка:
PYTHONPATH=build:. python3 test_bindings.py
PYTHONPATH=build:. python3 -c "import xenith; print(xenith.version(), xenith.backend_name())"
bin/Xenith gradcheck — числовая проверка градиентов (CPU)
bin/Xenith gradcheck --vulkan — то же на GPU-ядрах
документация python-API: docs/06-python-api.md
HINTS