-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
137 lines (114 loc) · 3.5 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
workspace "FragTal"
architecture "x64"
configurations
{
"Debug",
"Release"
}
startproject "FragTal"
arch = "%{cfg.architecture}"
config = "%{cfg.buildcfg}"
project "FragTal"
location "FragTal"
language "C++"
cppdialect "C++20"
staticruntime "On"
targetdir ("bin/" .. arch .. "/" .. config)
objdir ("bin/intermediates/" .. arch .. "/" .. config )
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
"%{prj.name}/ImGUI/**.h",
"%{prj.name}/ImGUI/**.cpp",
"%{prj.name}/Text Editor/**.h",
"%{prj.name}/Text Editor/**.cpp",
"%{prj.name}/UI/**.h",
"%{prj.name}/UI/**.cpp",
"%{prj.name}/Utils/**.h",
"%{prj.name}/Utils/**.cpp",
}
includedirs
{
"FragTal/deps/include"
}
libdirs
{
"FragTal/deps/lib/" .. arch .. "/SDL lib-vc2022"
}
--postbuildcommands
--{
-- "xcopy /Q /E /Y /I \"%{wks.location}\\%{prj.name}\\font\\*.ttf\" \"%{cfg.targetdir}\\font\\\"",
-- "xcopy /Q /E /Y /I \"%{wks.location}\\%{prj.name}\\src\\Shader.cpp\" \"%{cfg.targetdir}\\src\\\"",
-- "xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\*.ini\" \"%{cfg.targetdir}\\\"",
-- "xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\*.dll\" \"%{cfg.targetdir}\\\"",
-- "xcopy /Q /E /Y /I \"%{wks.location}\\deps\\include\\glm\" \"%{cfg.targetdir}\\glm\\\""
--}
postbuildcommands
{
-- Check if glm directory doesn't exist in the target directory before copying
"IF NOT EXIST \"%{cfg.targetdir}\\font\\\" xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\font\\*.ttf\" \"%{cfg.targetdir}\\font\\\"", -- Copy Fonts
"IF NOT EXIST \"%{cfg.targetdir}\\icon\\\" xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\icon\\*.ttf\" \"%{cfg.targetdir}\\icon\\\"", -- Copy Icons
"IF NOT EXIST \"%{cfg.targetdir}\\deps\\\" xcopy /Q /E /Y /I \"%{wks.location}\\%{prj.name}\\deps\\include\\glm\" \"%{cfg.targetdir}\\deps\\include\\glm\\\"", -- Copy GLM Math Library '/Y' for whole directory
"IF NOT EXIST \"%{cfg.targetdir}\\temp\\\" xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\temp\\*.txt\" \"%{cfg.targetdir}\\temp\\\"", -- Copy Error.txt file
"IF NOT EXIST \"%{cfg.targetdir}\\UI\\\" md \"%{cfg.targetdir}\\UI\\\"", -- Make the UI directory
"xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\src\\Shader.cpp\" \"%{cfg.targetdir}\\src\\\"", -- Copy Shader.cpp file
"xcopy /Q /Y /I \"%{wks.location}\\%{prj.name}\\src\\Shader.h\" \"%{cfg.targetdir}\\src\\\"" -- Copy Shader.h file
}
filter "system:windows"
systemversion "latest"
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
symbols "On"
optimize "Off"
buildoptions "/MTd"
links
{
--sdl2
"SDL2.lib",
"SDL2main.lib",
"SDL2test.lib"
}
kind "ConsoleApp" -- Make debug mode a console app
filter "configurations:Release"
defines { "RELEASE" }
runtime "Release"
symbols "Off"
optimize "Speed" -- Enable runtime optimization here
buildoptions "/MT"
links
{
--sdl2
"SDL2.lib",
"SDL2main.lib"
}
kind "WindowedApp" -- Make release mode a windowed app
vstudio = { }
vstudio.toolset = "latest"
vstudio.vc2022 = {
includeDirs = {
"deps/include"
}
}
vstudio.vc2022["Debug"] = {
libDirs = {
"deps/lib" .. arch .. "/SDL lib-vc2022"
},
links = {
--sdl2
"SDL2.lib",
"SDL2main.lib",
"SDL2test.lib"
}
}
vstudio.vc2022["Release"] = {
libDirs = {
"deps/lib" .. arch .. "/SDL lib-vc2022"
},
links = {
--sdl2
"SDL2.lib",
"SDL2main.lib"
}
}