-
Notifications
You must be signed in to change notification settings - Fork 0
/
rythe.lua
95 lines (77 loc) · 3.29 KB
/
rythe.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
include("_preload.lua")
premake.rythe = {
configuration = {
RELEASE = 1,
DEVELOPMENT = 2,
DEBUG = 3
},
configurationVariants = {
DEFAULT = 1,
ASAN = 2,
PROFILING = 3
},
loadedProjects = {},
buildSettings = {
architecture = "x86_64",
cppVersion = "C++20"
}
}
premake.rythe.buildSettings.toolsets = {
[premake.rythe.configuration.RELEASE] = { [premake.rythe.configurationVariants.DEFAULT] = "clang", [premake.rythe.configurationVariants.ASAN] = "msc", [premake.rythe.configurationVariants.PROFILING] = "clang" },
[premake.rythe.configuration.DEVELOPMENT] = { [premake.rythe.configurationVariants.DEFAULT] = "clang", [premake.rythe.configurationVariants.ASAN] = "msc", [premake.rythe.configurationVariants.PROFILING] = "clang" },
[premake.rythe.configuration.DEBUG] = { [premake.rythe.configurationVariants.DEFAULT] = "clang", [premake.rythe.configurationVariants.ASAN] = "msc", [premake.rythe.configurationVariants.PROFILING] = "clang" }
}
premake.rythe.configurationValidationLevels = {
[premake.rythe.configuration.RELEASE] = { [premake.rythe.configurationVariants.DEFAULT] = "0", [premake.rythe.configurationVariants.ASAN] = "0", [premake.rythe.configurationVariants.PROFILING] = "0" },
[premake.rythe.configuration.DEVELOPMENT] = { [premake.rythe.configurationVariants.DEFAULT] = "2", [premake.rythe.configurationVariants.ASAN] = "2", [premake.rythe.configurationVariants.PROFILING] = "2" },
[premake.rythe.configuration.DEBUG] = { [premake.rythe.configurationVariants.DEFAULT] = "3", [premake.rythe.configurationVariants.ASAN] = "3", [premake.rythe.configurationVariants.PROFILING] = "3" }
}
local rythe = premake.rythe
local projects = dofile("projects.lua")
function rythe.architecture(architecture)
rythe.buildSettings.architecture = architecture
end
function rythe.toolset(toolset)
for i, config in pairs(rythe.configuration) do
for j, variant in pairs(rythe.configurationVariants) do
rythe.buildSettings.toolsets[config][variant] = toolset
end
end
end
function rythe.cppVersion(cppVersion)
rythe.buildSettings.cppVersion = cppVersion
end
function rythe.overrideValidationLevel(config, variant, level)
rythe.configurationValidationLevels[config][variant] = tostring(level)
end
function rythe.overrideToolset(config, variant, toolset)
rythe.buildSettings.toolsets[config][variant] = toolset
end
function rythe.configName(config)
local configNames = {
[rythe.configuration.RELEASE] = "Release",
[rythe.configuration.DEVELOPMENT] = "Development",
[rythe.configuration.DEBUG] = "Debug",
}
return configNames[config]
end
function rythe.targetSuffix(config)
local configSuffix = {
[rythe.configuration.RELEASE] = "",
[rythe.configuration.DEVELOPMENT] = "-dev",
[rythe.configuration.DEBUG] = "-debug"
}
return configSuffix[config]
end
function rythe.targetVariantSuffix(variant)
local variantSuffix = {
[rythe.configurationVariants.DEFAULT] = "",
[rythe.configurationVariants.ASAN] = "-asan",
[rythe.configurationVariants.PROFILING] = "-profiling"
}
return variantSuffix[variant]
end
function rythe.configure()
projects.scan("./")
end
return rythe