-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
155 lines (126 loc) · 3.08 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
workspace "Sleet"
architecture "x64"
--toolset "msc"
toolset "clang"
startproject "Sandbox"
configurations
{
"Debug",
"Release"
}
flags
{
"MultiProcessorCompile"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
VULKAN_SDK = os.getenv("VULKAN_SDK")
IncludeDir = {}
IncludeDir["GLFW"] = "Sleet/vendor/glfw/include"
IncludeDir["VulkanSDK"] = "%{VULKAN_SDK}/Include"
LibraryDir = {}
LibraryDir["GLFW"] = "vendor/glfw"
LibraryDir["imgui"] = "vendor/imgui"
LibraryDir["VulkanSDK"] = "%{VULKAN_SDK}/Lib"
Library = {}
Library["Vulkan"] = "%{LibraryDir.VulkanSDK}/vulkan-1.lib"
Library["ShaderC_Debug"] = "%{LibraryDir.VulkanSDK}/shaderc_sharedd.lib"
Library["SPIRV_Cross_Debug"] = "%{LibraryDir.VulkanSDK}/spirv-cross-cored.lib"
Library["SPIRV_Cross_GLSL_Debug"] = "%{LibraryDir.VulkanSDK}/spirv-cross-glsld.lib"
Library["SPIRV_Cross_Reflect_Debug"] = "%{LibraryDir.VulkanSDK}/spirv-cross-reflectd.lib"
Library["ShaderC_Release"] = "%{LibraryDir.VulkanSDK}/shaderc_shared.lib"
Library["SPIRV_Cross_Release"] = "%{LibraryDir.VulkanSDK}/spirv-cross-core.lib"
Library["SPIRV_Cross_GLSL_Release"] = "%{LibraryDir.VulkanSDK}/spirv-cross-glsl.lib"
Library["SPIRV_Cross_Reflect_Release"] = "%{LibraryDir.VulkanSDK}/spirv-cross-reflect.lib"
group "Dependencies"
include "Sleet/vendor/glfw"
include "Sleet/vendor/imgui"
project "Sleet"
location "Sleet"
kind "StaticLib"
language "C++"
cppdialect "C++23"
staticruntime "off"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
pchheader "slpch.h"
pchsource "Sleet/src/slpch.cpp"
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.c",
"%{prj.name}/src/**.hpp",
"%{prj.name}/src/**.cpp",
}
includedirs
{
"%{prj.name}/src",
"%{prj.name}/vendor",
"%{prj.name}/vendor/tiny_gltf/",
"%{prj.name}/vendor/glfw/include",
"%{prj.name}/vendor/imgui",
"%{IncludeDir.VulkanSDK}"
}
links
{
"GLFW",
"imgui",
"%{Library.Vulkan}",
}
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
symbols "On"
links
{
"%{Library.ShaderC_Debug}",
"%{Library.SPIRV_Cross_Debug}",
"%{Library.SPIRV_Cross_Reflect_Debug}"
}
filter "configurations:Release"
defines { "NDEBUG" }
runtime "Release"
optimize "On"
links
{
"%{Library.ShaderC_Release}",
"%{Library.SPIRV_Cross_Release}",
"%{Library.SPIRV_Cross_Reflect_Release}"
}
project "Sandbox"
location "Sandbox"
kind "ConsoleApp"
language "C++"
cppdialect "C++23"
staticruntime "off"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
includedirs
{
"%{wks.location}/Sleet/src",
"%{wks.location}/Sleet/vendor",
"%{wks.location}/Sleet/vendor/glfw/include",
"%{IncludeDir.VulkanSDK}"
}
links
{
"Sleet"
}
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
symbols "On"
links
{
}
filter "configurations:Release"
defines { "NDEBUG" }
runtime "Release"
optimize "On"
links
{
}