-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake5.lua
174 lines (146 loc) · 4.53 KB
/
premake5.lua
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
output_dir = '%{cfg.buildcfg}_%{cfg.architecture}_%{cfg.system}'
workspace 'Vitro'
startproject 'Vitro'
architecture 'x64'
configurations { 'Debug', 'Development', 'Release' }
platforms { 'D3D12', 'Vulkan', 'D3D12+Vulkan' }
flags 'MultiProcessorCompile'
language 'C++'
cppdialect 'C++latest'
cdialect 'C11'
conformancemode 'On'
warnings 'Extra'
disablewarnings '4201' -- anonymous structs
floatingpoint 'Fast'
toolset 'MSC'
staticruntime 'On'
inheritdependencies 'Off'
files {
'%{prj.name}/**.cpp',
'%{prj.name}/**.hpp',
'%{prj.name}/**.hlsl',
'%{prj.name}/**.hlsli',
}
removefiles '**/Platform**/'
debugdir ('.bin/' .. output_dir .. '/%{prj.name}')
targetdir ('.bin/' .. output_dir .. '/%{prj.name}')
objdir ('.bin_int/' .. output_dir .. '/%{prj.name}')
filter 'files:**.cpp'
compileas 'Module' -- Change to ModulePartition eventually
filter 'files:**.hlsl'
buildmessage 'Compiling shader %{file.relpath}'
buildcommands ('..\\.bin\\' .. output_dir .. '\\VitroHlslBuilder\\VitroHlslBuilder %{file.abspath} --api=%{cfg.platform} --out=%{cfg.targetdir} --sm=5_1')
filter 'Debug'
symbols 'On'
runtime 'Debug'
defines 'VT_DEBUG'
filter 'Development'
symbols 'On'
optimize 'Speed'
runtime 'Debug'
defines 'VT_DEBUG'
flags 'LinkTimeOptimization'
filter 'Release'
optimize 'Speed'
runtime 'Release'
flags 'LinkTimeOptimization'
filter 'system:Windows'
systemversion 'latest'
files '%{prj.name}/**PlatformWindows/*'
links 'user32'
defines {
'VT_SYSTEM_WINDOWS',
'VT_SYSTEM_MODULE=Windows',
'VT_SYSTEM_NAME=windows',
}
filter 'platforms:D3D12'
defines {
'VT_GPU_API_MODULE=D3D12',
'VT_GPU_API_NAME=d3d12',
'VT_GPU_API_D3D12',
'VT_SHADER_EXTENSION="cso"',
}
filter 'platforms:Vulkan'
defines {
'VT_GPU_API_MODULE=Vulkan',
'VT_GPU_API_NAME=vulkan',
'VT_GPU_API_VULKAN',
'VT_SHADER_EXTENSION="spv"',
}
filter 'platforms:D3D12+Vulkan'
defines {
'VT_DYNAMIC_GPU_API',
'VT_GPU_API_MODULE=D3D12',
'VT_GPU_API_NAME=d3d12',
'VT_GPU_API_MODULE_SECONDARY=Vulkan',
'VT_GPU_API_NAME_SECONDARY=vulkan',
'VT_GPU_API_D3D12',
'VT_GPU_API_VULKAN',
}
filter { 'files:**.hlsl', 'platforms:D3D12 or D3D12+Vulkan' }
buildoutputs '%{cfg.targetdir}/%{file.basename}.cso'
filter { 'files:**.hlsl', 'platforms:Vulkan or D3D12+Vulkan' }
buildoutputs '%{cfg.targetdir}/%{file.basename}.spv'
project 'Vitro'
location '%{prj.name}'
kind 'ConsoleApp'
includedirs { '', 'Dependencies' }
defines 'VT_ENGINE_NAME="%{prj.name}"'
targetname '%{prj.name}%{cfg.platform}'
links {
'VitroCore',
'VitroHlslBuilder',
'tinyobjloader',
}
filter 'Debug or Development'
debugargs { '--debug-gpu-api' }
filter 'Release'
kind 'WindowedApp'
entrypoint 'mainCRTStartup'
filter 'platforms:D3D12 or D3D12+Vulkan'
links { 'd3d12', 'dxgi', 'D3D12MemoryAllocator' }
files '%{prj.name}/**/PlatformD3D12/*'
filter 'platforms:Vulkan or D3D12+Vulkan'
links 'VulkanMemoryAllocator'
files '%{prj.name}/**/PlatformVulkan/*'
includedirs 'C:/VulkanSDK/**/Include'
project 'VitroCore'
location '%{prj.name}'
kind 'StaticLib'
includedirs { '', 'Dependencies' }
project 'VitroHlslBuilder'
location '%{prj.name}'
kind 'ConsoleApp'
allmodulespublic 'On'
includedirs { '' }
links 'VitroCore'
filter 'platforms:D3D12 or D3D12+Vulkan'
links 'D3DCompiler'
group 'Dependencies'
deploc = 'Dependencies/%{prj.name}'
depsubmoddir = 'Dependencies/%{prj.name}/%{prj.name}'
project 'NatvisFiles'
location (deploc)
kind 'None'
files '**.natvis'
project 'tinyobjloader'
location (deploc)
warnings 'Off'
kind 'StaticLib'
files (depsubmoddir .. '/tiny_obj_loader.cc')
project 'D3D12MemoryAllocator'
location (deploc)
warnings 'Off'
kind 'None'
includedirs (depsubmoddir .. '/include')
files (depsubmoddir .. '/src/D3D12MemAlloc.cpp')
filter 'platforms:D3D12 or D3D12+Vulkan'
kind 'StaticLib'
project 'VulkanMemoryAllocator'
location (deploc)
warnings 'Off'
kind 'None'
files (deploc .. '/VulkanMemoryAllocator.cpp')
includedirs 'C:/VulkanSDK/**/Include'
filter 'platforms:Vulkan or D3D12+Vulkan'
kind 'StaticLib'