-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
79 lines (58 loc) · 1.75 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
---@diagnostic disable: undefined-global
local ProjectName = "Algorithms"
local function GetBasePath()
return debug.getinfo(1).source:match("@?(.*/)")
end
workspace "Saffron"
architecture "x64"
configurations {
"Debug",
"Release",
"Dist"
}
flags {
"MultiProcessorCompile"
}
location (WrkLoc)
startproject (ProjectName)
local SaffronEngine2D = require("ThirdParty.SaffronEngine2D.premake5")
project (ProjectName)
kind "ConsoleApp"
language "C++"
cppdialect "C++20"
staticruntime "On"
objdir (OutObj)
location (OutLoc)
filter "configurations:Debug or Release"
targetdir (OutBin)
SaffronEngine2D.PreBuild("Debug", OutBin, PrjLoc)
SaffronEngine2D.PostBuild("Debug", OutBin, PrjLoc)
SaffronEngine2D.PreBuild("Release", OutBin, PrjLoc)
SaffronEngine2D.PostBuild("Release", OutBin, PrjLoc)
filter "configurations:Dist"
targetdir (OutBinDist)
SaffronEngine2D.PreBuild("Dist", OutBinDist, PrjLoc)
SaffronEngine2D.PostBuild("Dist", OutBinDist, PrjLoc)
filter "configurations:Debug or Release or Dist"
files {
"Source/**.h",
"Source/**.c",
"Source/**.hpp",
"Source/**.cpp",
}
includedirs {
"Source",
}
SaffronEngine2D.Include()
SaffronEngine2D.Link()
SaffronEngine2D.AddDefines()
local from = GetBasePath() .. AstFol
CopyAssetsToOutput("Debug", from, OutBin .. AstFol, PrjLoc .. AstFol)
CopyAssetsToOutput("Release", from, OutBin .. AstFol, PrjLoc .. AstFol)
CopyAssetsToOutput("Dist", from, OutBinDist .. AstFol, PrjLoc .. AstFol)
filter "configurations:Debug"
symbols "On"
filter "configurations:Release"
optimize "On"
filter "configurations:Dist"
optimize "On"