-
Notifications
You must be signed in to change notification settings - Fork 5
/
premake5.lua
142 lines (111 loc) · 2.55 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
dependencies = {
basePath = "./deps"
}
function dependencies.load()
dir = path.join(dependencies.basePath, "premake/*.lua")
deps = os.matchfiles(dir)
for i, dep in pairs(deps) do
dep = dep:gsub(".lua", "")
require(dep)
end
end
function dependencies.imports()
for i, proj in pairs(dependencies) do
if type(i) == 'number' then
proj.import()
end
end
end
function dependencies.projects()
for i, proj in pairs(dependencies) do
if type(i) == 'number' then
proj.project()
end
end
end
dependencies.load()
workspace "alterware-master"
startproject "alterware-master"
location "./build"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
configurations {"debug", "release"}
language "C++"
cppdialect "C++20"
if os.istarget("darwin") then
platforms {"x64", "arm64"}
else
platforms {"x86", "x64", "arm64"}
end
filter "platforms:x86"
architecture "x86"
filter {}
filter "platforms:x64"
architecture "x86_64"
filter {}
filter "platforms:arm64"
architecture "ARM64"
filter {}
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
filter { "system:linux", "system:macosx" }
buildoptions "-pthread"
linkoptions "-pthread"
filter {}
if os.istarget("linux") then
filter { "toolset:clang*", "platforms:arm64" }
buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu"
filter {}
filter { "toolset:clang*" }
buildoptions "-stdlib=libc++"
linkoptions "-stdlib=libc++"
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
filter {}
end
filter { "system:macosx", "platforms:arm64" }
buildoptions "-arch arm64"
linkoptions "-arch arm64"
filter {}
if os.getenv("CI") then
defines "CI"
end
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
filter "configurations:release"
optimize "Size"
defines "NDEBUG"
flags "FatalCompileWarnings"
filter {}
filter "configurations:debug"
optimize "Debug"
defines {"DEBUG", "_DEBUG"}
filter {}
project "alterware-master"
kind "ConsoleApp"
language "C++"
pchheader "std_include.hpp"
pchsource "src/std_include.cpp"
files {"./src/**.rc", "./src/**.hpp", "./src/**.cpp"}
includedirs {"./src", "%{prj.location}/src"}
filter "system:windows"
files {
"./src/**.rc",
}
filter {}
filter { "system:windows", "toolset:not msc*" }
resincludedirs {
"%{_MAIN_SCRIPT_DIR}/src"
}
filter {}
filter { "system:windows", "toolset:msc*" }
resincludedirs {
"$(ProjectDir)src"
}
filter {}
dependencies.imports()
group "Dependencies"
dependencies.projects()