forked from NVIDIAGameWorks/Falcor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_vs2019.bat
47 lines (40 loc) · 1.19 KB
/
setup_vs2019.bat
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
: This script sets up a Visual Studio 2019 solution.
: It takes an optional argument to specify the render backend:
: - d3d12 Native D3D12 backend (default)
: - gfx-d3d12 Slang/GFX D3D12 backend
: - gfx-vk Slang/GFX Vulkan backend
@echo off
setlocal
if "%~1"=="" (
set BACKEND=d3d12
) else if "%~1"=="d3d12" (
set BACKEND=d3d12
) else if "%~1"=="gfx-d3d12" (
set BACKEND=gfx-d3d12
) else if "%~1"=="gfx-vk" (
set BACKEND=gfx-vk
) else (
echo Error: Unknown rendering backend, use d3d12, gfx-d3d12 or gfx-vk.
exit /b 1
)
: Fetch dependencies.
call %~dp0\setup.bat
: Configuration.
set PRESET=windows-vs2019-%BACKEND%
set TOOLSET=host=x86
set CMAKE_EXE=%~dp0\tools\.packman\cmake\bin\cmake.exe
set CUSTOM_CUDA_DIR=%~dp0\external\packman\cuda
: Check if custom CUDA directory contains a valid CUDA SDK.
: Adjust toolset string to use the custom CUDA toolkit.
if exist %CUSTOM_CUDA_DIR%\bin\nvcc.exe (
set TOOLSET=%TOOLSET%,cuda="%CUSTOM_CUDA_DIR%"
)
: Configure solution by running cmake.
echo Configuring Visual Studio solution ...
%CMAKE_EXE% --preset %PRESET% -T %TOOLSET%
if errorlevel 1 (
echo Failed to configure solution!
exit /b 1
)
: Success.
exit /b 0