forked from gta-reversed/gta-reversed
-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake5.lua
90 lines (73 loc) · 2.04 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
--[[
GTA_reversed Build Script
Use 'premake5 --help' for help
--]]
--[[
Options and Actions
--]]
newoption {
trigger = "script-tracing",
description = "Enable script command trace logging (Slow!)"
}
newoption {
trigger = "outdir",
value = "path",
description = "Output directory for the build files"
}
newoption {
trigger = "allow-script-cmd-hooks",
description = "Whenever script command hooks should be generated (Slows down (full) build by a lot)"
}
if not _OPTIONS["outdir"] then
_OPTIONS["outdir"] = "build"
end
--[[
The Solution
--]]
workspace "gta_reversed"
startproject "gta_sa_modern"
configurations { "Release", "Debug" }
location(_OPTIONS["outdir"])
targetprefix "" -- no 'lib' prefix on gcc
targetdir("bin/%{cfg.buildcfg}")
filter "configurations:Debug*"
staticruntime "off"
symbols "On"
runtime "Debug"
vectorextensions "AVX2"
defines { "NOTSA_DEBUG" }
filter "configurations:Release*"
staticruntime "off"
symbols "On"
runtime "Release"
vectorextensions "AVX2"
defines { "NDEBUG" }
optimize "Full"
flags { "LinkTimeOptimization" }
filter "action:vs*"
flags { "MultiProcessorCompile" }
linkoptions { "/ignore:4099,4251,4275" }
buildoptions { "/EHsc", "/Zc:preprocessor", "/bigobj", "/utf-8" }
disablewarnings { 26812, 26495, 4275, 4251, 4200, 4099 }
filter "files:libs/**"
warnings "Off"
filter {}
characterset "MBCS" -- Fix strings
staticruntime "On"
rtti "Off"
flags {
"NoImportLib",
--"NoBufferSecurityCheck"
"FatalWarnings",
}
include "source/"
local gta_exe = os.getenv("GTA_SA_EXE")
if gta_exe ~= nil and os.isfile(gta_exe) then
debugcommand "$(GTA_SA_EXE)"
else
debugcommand "$(GTA_SA_DIR)/gta_sa.exe"
end
debugdir "$(GTA_SA_DIR)"
group "Dependencies"
defines { "WIN32", "_WINDOWS" }
include "libs/"