-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpremake5-properties.lua
More file actions
221 lines (187 loc) · 4.29 KB
/
premake5-properties.lua
File metadata and controls
221 lines (187 loc) · 4.29 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
property "e2_ws_settings"
language 'C++'
cppdialect 'C++17'
flags 'MultiProcessorCompile'
shortcommands 'On'
linkgroups 'On'
pic 'On'
floatingpointexceptions 'Off'
unsignedchar 'On'
objdir "build/obj"
targetdir "%{_MAIN_SCRIPT_DIR}/build/bin/%{cfg.platform}/%{cfg.buildcfg}"
libdirs {
"build/thirdpartylib/",
"build/lib/"
}
location "%{ prj_location(prj, wks) }"
filter "kind:StaticLib"
targetdir "build/lib/%{cfg.platform}/%{cfg.buildcfg}"
-- MSVC thing only
filter "system:Windows"
implibdir "build/lib/%{cfg.platform}/%{cfg.buildcfg}"
property "e2_ws_configurations"
filter "configurations:Debug"
defines {
"DEBUG"
}
symbols "On"
filter "configurations:Release"
defines {
"NDEBUG",
}
optimize "On"
symbols "On"
filter "configurations:ReleaseAsan"
defines {
"NDEBUG",
}
optimize "On"
symbols "On"
sanitize "address"
filter "configurations:Profile"
defines {
"NDEBUG",
"_PROFILE"
}
optimize "Speed"
symbols "On"
rtti "Off"
filter "configurations:Retail"
defines {
"NDEBUG",
"_RETAIL"
}
optimize "Speed"
rtti "Off"
filter { "configurations:Retail", "system:Windows" }
buildoptions { "/GL", "/Ot" }
linkoptions { "/LTCG:incremental" }
filter "system:Linux"
defines {
"__LINUX__"
}
----
filter "system:android"
floatingpointexceptions 'On' -- can't remember, probably for NEON
platforms {
"android-arm",
"android-arm64"
--"android-x86_64"
}
buildoptions {
"-pthread"
}
linkoptions {
"--no-undefined",
"-pthread",
"-mfloat-abi=softfp", -- force NEON to be used
"-mfpu=neon"
}
filter "platforms:*-x86"
architecture "x86"
filter "platforms:*-x86_64"
architecture "x86_64"
filter "platforms:*-arm"
architecture "arm"
filter "platforms:*-arm64"
architecture "arm64"
filter "system:linux"
platforms {
--"x86",
"x64"
-- TODO: arm
}
filter "system:Windows"
platforms {
--"x86",
"x64"
-- TODO: arm
}
property "windows_msvc"
filter "system:Windows"
-- use specific windows SDK
systemversion(WINSDK_VER)
linkoptions {
"/NOEXP"
}
disablewarnings {
"4996",
"4554",
"4244",
"4101",
"4838",
"4309"
}
enablewarnings {
"26433"
}
filter {"system:Windows", "configurations:Retail or configurations:Profile" }
buildoptions { "/GR-" }
property "gcc_clang"
filter "system:Linux or system:Android"
links { "pthread" }
buildoptions {
"-fpermissive",
}
disablewarnings {
-- disable warnings which are emitted by my stupid (and not so) code
"narrowing",
"c++11-narrowing",
"writable-strings",
"logical-op-parentheses",
"parentheses",
"register",
"unused-local-typedef",
"nonportable-include-path",
"format-security",
"unused-parameter",
"sign-compare",
"ignored-attributes", -- annyoing, don't re-enable
"write-strings", -- TODO: fix this
"subobject-linkage" -- TODO: fix this
}
property "unitybuild"
if not BUILD_SINGLE_FILE then
unitybuild "on"
maxfilesinunity "30"
end
property "sharedlib"
kind "SharedLib"
property "staticlib"
kind "StaticLib"
property "app"
filter "platforms:*64"
debugdir "%{wks.location}../../build/Bin64"
debugenvs "PATH=%{wks.location}../../build/Bin64"
filter "platforms:*86"
debugdir "%{wks.location}../../build/Bin32"
debugenvs "PATH=%{wks.location}../../build/Bin64"
property "tools"
filter "configurations:Retail or configurations:Profile"
kind "None"
property "thirdpartylib"
--[[configmap {
["Debug"] = "Debug",
["Release"] = "Release",
["ReleaseAsan"] = "Release",
["Profile"] = "Retail",
["Retail"] = "Retail",
}]] -- fookin std annotate_string & annotate_vector
targetdir "build/thirdpartylib/%{cfg.platform}/%{cfg.buildcfg}"
function prj_location(prj, wks, def)
if _ACTION == "vscode" then
return _MAIN_SCRIPT_DIR
end
if _ACTION == "gmake2" and wks ~= nil and def == nil then
def = _MAIN_SCRIPT_DIR.."/build/"..wks.name..".solution"
else
def = _MAIN_SCRIPT_DIR .. "/build/"
end
if prj ~= nil then
if prj.group ~= nil and string.len(prj.group) > 0 then
return "build/" .. prj.group .. '/' .. prj.name
end
return "build/" .. prj.name
end
return def
end