-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-build-system.bat
More file actions
97 lines (85 loc) · 3.88 KB
/
setup-build-system.bat
File metadata and controls
97 lines (85 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
: setup-build-system.bat — VisCache Falcor 8.0 integration setup script (Windows)
: Run from the VisCache package root: .\setup-build-system.bat
:
: What this script does:
: 1. Verifies Falcor root, enables git hooks
: 2. Copies VisCache source files into the Falcor tree
: 3. Patches CMakeLists.txt to register the plugins
: 4. Calls Falcor\setup_vs2022.bat (submodule init, packman deps, VS2022 solution)
: 5. Runs the Python unit tests
@echo off
setlocal enabledelayedexpansion
set SCRIPT_DIR=%~dp0
set FALCOR_ROOT=%SCRIPT_DIR%Falcor
: Publish the project root so Falcor\setup.bat can find it without relying
: on fragile relative-path navigation. Falcor is a subtree, not a standalone
: repo, so its setup script cannot know the git root on its own.
: Strip trailing backslash so "git -C "%VISCACHE_ROOT%"" does not see \"
set VISCACHE_ROOT=%SCRIPT_DIR%
if "%VISCACHE_ROOT:~-1%"=="\" set VISCACHE_ROOT=%VISCACHE_ROOT:~0,-1%
: ---------------------------------------------------------------------------
: Step 1: Verify Falcor root
: ---------------------------------------------------------------------------
echo [VisCache] Step 1: SCRIPT_DIR=%SCRIPT_DIR%
echo [VisCache] Step 1: FALCOR_ROOT=%FALCOR_ROOT%
echo [VisCache] Step 1: VISCACHE_ROOT=%VISCACHE_ROOT%
: ---------------------------------------------------------------------------
: Step 1b: Enable git hooks
: ---------------------------------------------------------------------------
if exist "%SCRIPT_DIR%.githooks\" (
echo [VisCache] Step 1b: Enabling git hooks...
git -C "%SCRIPT_DIR%." config core.hooksPath .githooks
)
if not exist "%FALCOR_ROOT%\CMakeLists.txt" (
echo [VisCache] ERROR: CMakeLists.txt not found in %FALCOR_ROOT%
exit /b 1
)
: ---------------------------------------------------------------------------
: Steps 2-3: Plugin integration
: ---------------------------------------------------------------------------
: Plugins build in-place via FALCOR_PLUGIN_DIRS (no source copy needed).
: CMake patches are committed in the Falcor subtree.
: Scripts, data, and shaders are deployed by CMake POST_BUILD rules.
echo [VisCache] Steps 2-3: Plugin integration handled by CMake (no copy needed)
: ---------------------------------------------------------------------------
: Step 4: Run Falcor's own setup (submodules, packman deps, VS2022 solution)
: ---------------------------------------------------------------------------
echo [VisCache] Step 4: Running Falcor setup (submodules + packman + VS2022)...
if not exist "%FALCOR_ROOT%\setup_vs2022.bat" (
echo [VisCache] WARNING: setup_vs2022.bat not found, skipping Falcor setup.
echo [VisCache] You may need to init submodules and fetch packman deps manually.
goto :skip_falcor_setup
)
REM setup_vs2022.bat runs cmake --preset which needs CWD inside Falcor
pushd "%FALCOR_ROOT%"
call "%FALCOR_ROOT%\setup_vs2022.bat" --host x64
set SETUP_ERR=!errorlevel!
popd
if !SETUP_ERR! neq 0 (
echo [VisCache] ERROR: Falcor setup failed!
exit /b 1
)
echo [VisCache] Falcor setup complete.
:skip_falcor_setup
: ---------------------------------------------------------------------------
: Step 5: Run Python unit tests
: ---------------------------------------------------------------------------
echo [VisCache] Step 5: Running CPU unit tests...
python "%SCRIPT_DIR%tests\test_viscache_convergence.py"
if errorlevel 1 (
echo [VisCache] ERROR: Unit tests failed!
exit /b 1
)
echo [VisCache] All unit tests passed.
: ---------------------------------------------------------------------------
: Done
: ---------------------------------------------------------------------------
echo.
echo [VisCache] Setup complete.
echo.
echo Next steps:
echo 1. Open %FALCOR_ROOT%\build\windows-vs2022\Falcor.sln in Visual Studio
echo 2. Build target: Mogwai (Release, x64)
echo 3. Run: Mogwai.exe --script scripts/VisCache/VisCache_Graph.py --scene BistroInterior.pyscene
echo.
exit /b 0