-
Notifications
You must be signed in to change notification settings - Fork 3
/
premake5.lua
107 lines (88 loc) · 2.52 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
-- Custom API additions START
require('vstudio')
premake.api.register {
name = "vcpkg",
scope = "config",
kind = "boolean"
}
premake.api.register {
name = "vcpkgmanifest",
scope = "config",
kind = "boolean"
}
premake.api.register {
name = "vcpkgstatic",
scope = "config",
kind = "boolean"
}
premake.api.register {
name = "vcpkgconfig",
scope = "config",
kind = "string"
}
premake.override(premake.vstudio.vc2010.elements, "configurationProperties", function(base, cfg)
local calls = base(cfg)
table.insert(calls, function(cfg)
if cfg.vcpkg ~= nil then
premake.w('<VcpkgEnabled>%s</VcpkgEnabled>', cfg.vcpkg)
end
if cfg.vcpkgmanifest ~= nil then
premake.w('<VcpkgEnableManifest>%s</VcpkgEnableManifest>', cfg.vcpkgmanifest)
end
if cfg.vcpkgstatic ~= nil then
premake.w('<VcpkgUseStatic>%s</VcpkgUseStatic>', cfg.vcpkgstatic)
end
if cfg.vcpkgconfig ~= nil then
premake.w('<VcpkgConfiguration>%s</VcpkgConfiguration>', cfg.vcpkgconfig)
end
end)
return calls
end)
-- Custom API additions END
workspace "SilentPatchNFS90s"
platforms { "Win32" }
project "SilentPatchNFS90s"
kind "SharedLib"
targetextension ".asi"
language "C++"
dofile "source/VersionInfo.lua"
files { "**/MemoryMgr.h", "**/Patterns.*", "**/HookInit.hpp" }
workspace "*"
configurations { "Debug", "Release", "Shipping" }
location "build"
vpaths { ["Headers/*"] = "source/**.h",
["Sources/*"] = { "source/**.c", "source/**.cpp" },
["Resources"] = "source/**.rc"
}
files { "source/*.h", "source/*.cpp", "source/resources/*.rc" }
-- Disable exceptions in WIL
defines { "WIL_SUPPRESS_EXCEPTIONS" }
cppdialect "C++17"
staticruntime "on"
buildoptions { "/sdl" }
warnings "Extra"
-- Automated defines for resources
defines { "rsc_Extension=\"%{prj.targetextension}\"",
"rsc_Name=\"%{prj.name}\"" }
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
filter "configurations:Shipping"
defines { "NDEBUG", "RESULT_DIAGNOSTICS_LEVEL=0", "RESULT_INCLUDE_CALLER_RETURNADDRESS=0" }
linkoptions { "/pdbaltpath:%_PDB%" }
filter "configurations:not Debug"
optimize "Speed"
functionlevellinking "on"
flags { "LinkTimeOptimization" }
filter { "platforms:Win32" }
system "Windows"
architecture "x86"
filter { "platforms:Win64" }
system "Windows"
architecture "x86_64"
filter { "toolset:*_xp"}
defines { "WINVER=0x0501", "_WIN32_WINNT=0x0501" } -- Target WinXP
buildoptions { "/Zc:threadSafeInit-" }
filter { "toolset:not *_xp"}
defines { "WINVER=0x0601", "_WIN32_WINNT=0x0601" } -- Target Win7
conformancemode "on"