Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
120 lines (96 loc) · 3.21 KB
/
Copy pathpremake5.lua
File metadata and controls
120 lines (96 loc) · 3.21 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
include "Settings.lua"
include "Dependencies.lua"
workspace "OpenBlob"
cppdialect "C++20"
characterset "ASCII"
configurations { "Debug", "Release", "Final" }
platforms "Win32"
-- Enables fast builds
multiprocessorcompile "on"
disablewarnings { "4996" }
debugdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
editandcontinue "Off"
-- Global defines
defines
{
"_CRT_SECURE_NO_WARNINGS",
"NOMINMAX",
"DEBLOB_COMMUNITY_PATCH", -- Fixes of retail bugs and dev features; the original code is kept in #else
-- NOTE: no "USE_ATOMIC" (Barnyard's atomic TMutex, TSemaphore and TFifo): de Blob uses the Win32 objects
}
-- Global settings for include dirs
includedirs
{
"%{IncludeDir.toshi}"
}
filter "options:arch=x86"
architecture "x86"
-- Global Windows parameters
filter "system:windows"
systemversion "latest"
vectorextensions "SSE2"
-- Retail's build shape (DevTools/Matching/README.md): /Gz (__stdcall default calling convention: free and static
-- functions end in "ret n") and /EHsc (retail has C++ EH frames). Every project, the vendored C libraries too
-- (retail's ogg/vorbis code is __stdcall as well; their qsort comparators are explicitly __cdecl)
callingconvention "StdCall" -- /Gz
exceptionhandling "On" -- /EHsc
linkoptions "/SAFESEH:NO"
defines
{
"TOSHI_SKU_WINDOWS"
}
filter "options:renderer=DX11"
defines
{
"TRENDERINTERFACE_DX11"
}
filter "configurations:Debug"
runtime "Debug"
defines "TOSHI_DEBUG"
symbols "On"
filter "configurations:Release"
runtime "Release"
defines "TOSHI_RELEASE"
filter "configurations:Final"
runtime "Release"
defines "TOSHI_FINAL"
-- Retail's optimisation flags: /O2 /Oy- /Ob2 /Oi /GS /Gy /GR /GF /arch:SSE2 /fp:precise /MD, no /GL
filter "configurations:Release or Final"
optimize "Speed" -- /O2
omitframepointer "Off" -- /Oy-: every retail function has push ebp / mov ebp, esp
inlining "Auto" -- /Ob2
intrinsics "On" -- /Oi
functionlevellinking "On" -- /Gy
stringpooling "On" -- /GF
buffersecuritycheck "On" -- /GS
rtti "On" -- /GR
floatingpoint "Default" -- /fp:precise
linktimeoptimization "Off" -- no /GL
filter {}
-- Include the projects
group "Engine"
include "Toshi"
include "OpenBlob"
-- Ogg Theora movies (Data\Movies\*.bik.ogv): libogg, libvorbis, libtheora and theoraplay (library code, see
-- Tools/ProgressCalculation/ignorelist.txt)
group "Vendor"
include "Toshi/Vendor/libogg"
include "Toshi/Vendor/libvorbis"
include "Toshi/Vendor/libtheora"
include "Toshi/Vendor/theoraplay"
-- NOTE: the vendored projects link the static CRT; Toshi and OpenBlob use the CRT DLL
for _, name in ipairs( { "libogg", "libvorbis", "libtheora", "theoraplay" } ) do
project( name )
staticruntime "off"
warnings "Off"
-- NOTE: optimised in Debug too (an unoptimised decoder can't keep up with the movies)
filter "configurations:Debug"
optimize "Speed"
runtimechecks "Off"
filter "configurations:Final"
runtime "Release"
optimize "On"
filter {}
end