-
Notifications
You must be signed in to change notification settings - Fork 20
/
3-Prepare NRD SDK.bat
111 lines (80 loc) · 2.64 KB
/
3-Prepare NRD SDK.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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@echo off
set NRD_DIR=External\NRD
set NRI_DIR=External\NRIFramework\External\NRI
set "copy_shaders="
set "no_copy_shaders="
set "copy_integration="
set "no_copy_integration="
:PARSE
if "%~1"=="" goto :MAIN
if /i "%~1"=="-h" goto :HELP
if /i "%~1"=="--help" goto :HELP
if /i "%~1"=="--shaders" set "copy_shaders=y"
if /i "%~1"=="--no-shaders" set "no_copy_shaders=y"
if /i "%~1"=="--integration" set "copy_integration=y"
if /i "%~1"=="--no-integration" set "no_copy_integration=y"
shift
goto :PARSE
:MAIN
rd /q /s "_NRD_SDK"
mkdir "_NRD_SDK\Include"
mkdir "_NRD_SDK\Lib\Debug"
mkdir "_NRD_SDK\Lib\Release"
mkdir "_NRD_SDK\Shaders"
mkdir "_NRD_SDK\Shaders\Include"
cd "_NRD_SDK"
copy "..\%NRD_DIR%\Include\*" "Include"
copy "..\_Bin\Debug\NRD.dll" "Lib\Debug"
copy "..\_Bin\Debug\NRD.lib" "Lib\Debug"
copy "..\_Bin\Debug\NRD.pdb" "Lib\Debug"
copy "..\_Bin\Release\NRD.dll" "Lib\Release"
copy "..\_Bin\Release\NRD.lib" "Lib\Release"
copy "..\_Bin\Release\NRD.pdb" "Lib\Release"
copy "..\%NRD_DIR%\Shaders\Include\NRD.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\Shaders\Include\NRDEncoding.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\LICENSE.txt" "."
copy "..\%NRD_DIR%\README.md" "."
echo.
if defined copy_shaders goto :SHADERS
if defined no_copy_shaders goto :PRE_INTEGRATION
set /P M=Do you need the shader source code for a white-box integration? [y/n]
if /I "%M%" neq "y" goto :PRE_INTEGRATION
:SHADERS
mkdir "Shaders"
xcopy "..\%NRD_DIR%\Shaders\" "Shaders" /s /y
copy "..\%NRD_DIR%\External\MathLib\*.hlsli" "Shaders\Source"
:PRE_INTEGRATION
echo.
if defined copy_integration goto :INTEGRATION
if defined no_copy_integration goto :END
set /P M=Do you need NRD integration layer? [y/n]
if /I "%M%" neq "y" goto :END
:INTEGRATION
mkdir "Integration"
copy "..\%NRD_DIR%\Integration\*" "Integration"
cd ..
rd /q /s "_NRI_SDK"
mkdir "_NRI_SDK\Include\Extensions"
mkdir "_NRI_SDK\Lib\Debug"
mkdir "_NRI_SDK\Lib\Release"
cd "_NRI_SDK"
copy "..\%NRI_DIR%\Include\*" "Include"
copy "..\%NRI_DIR%\Include\Extensions\*" "Include\Extensions"
copy "..\_Bin\Debug\NRI.dll" "Lib\Debug"
copy "..\_Bin\Debug\NRI.lib" "Lib\Debug"
copy "..\_Bin\Debug\NRI.pdb" "Lib\Debug"
copy "..\_Bin\Release\NRI.dll" "Lib\Release"
copy "..\_Bin\Release\NRI.lib" "Lib\Release"
copy "..\_Bin\Release\NRI.pdb" "Lib\Release"
copy "..\%NRI_DIR%\LICENSE.txt" "."
cd ..
:END
cd ..
exit /b %errorlevel%
:HELP
echo. -h, --help show help message
echo. --shaders copy shaders for a white-box integration
echo. --no-shaders do not copy shaders for a white-box integration
echo. --integration copy NRD integration layer
echo. --no-integration do not copy NRD integration layer
exit