-
Notifications
You must be signed in to change notification settings - Fork 5
/
premake5.lua
208 lines (187 loc) · 8.65 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
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
workspace "XboxRainDroplets"
configurations { "Release", "Debug" }
architecture "x86"
location "build"
cppdialect "C++latest"
kind "SharedLib"
language "C++"
targetextension ".asi"
linkoptions "/SAFESEH:NO"
buildoptions { "/Zc:__cplusplus /utf-8" }
flags { "MultiProcessorCompile" }
defines { "_CRT_SECURE_NO_WARNINGS" }
characterset ("Unicode")
defines { "rsc_CompanyName=\"ThirteenAG\"" }
defines { "rsc_LegalCopyright=\"MIT License\""}
defines { "rsc_FileVersion=\"1.0.0.0\"", "rsc_ProductVersion=\"1.0.0.0\"" }
defines { "rsc_InternalName=\"%{prj.name}\"", "rsc_ProductName=\"%{prj.name}\"", "rsc_OriginalFilename=\"%{prj.name}.dll\"" }
defines { "rsc_FileDescription=\"Xbox Rain Droplets Plugin\"" }
defines { "rsc_UpdateUrl=\"https://github.com/ThirteenAG/XboxRainDroplets\"" }
includedirs { "source" }
includedirs { "external" }
files { "source/%{prj.name}.cpp" }
files { "source/resources/Versioninfo.rc" }
files { "source/resources/Dropmask.rc" }
files { "external/hooking/Hooking.Patterns.h", "external/hooking/Hooking.Patterns.cpp" }
files { "external/injector/safetyhook/include/**.hpp", "external/injector/safetyhook/src/**.cpp" }
files { "external/injector/zydis/**.h", "external/injector/zydis/**.c" }
includedirs { "external/hooking" }
includedirs { "external/injector/include" }
includedirs { "external/injector/safetyhook/include" }
includedirs { "external/injector/zydis" }
includedirs { "external/FusionDxHook/includes" }
includedirs { "external/sire" }
files { "external/sire/sire.h" }
pbcommands = {
"setlocal EnableDelayedExpansion",
--"set \"path=" .. (gamepath) .. "\"",
"set file=$(TargetPath)",
"FOR %%i IN (\"%file%\") DO (",
"set filename=%%~ni",
"set fileextension=%%~xi",
"set target=!path!!filename!!fileextension!",
"if exist \"!target!\" copy /y \"!file!\" \"!target!\"",
")" }
function setpaths (gamepath, exepath, scriptspath)
scriptspath = scriptspath or "scripts/"
if (gamepath) then
cmdcopy = { "set \"path=" .. gamepath .. scriptspath .. "\"" }
table.insert(cmdcopy, pbcommands)
postbuildcommands (cmdcopy)
debugdir (gamepath)
if (exepath) then
debugcommand (gamepath .. exepath)
dir, file = exepath:match'(.*/)(.*)'
debugdir (gamepath .. (dir or ""))
end
end
targetdir ("bin")
end
function add_kananlib()
defines { "BDDISASM_HAS_MEMSET", "BDDISASM_HAS_VSNPRINTF" }
files { "external/injector/kananlib/include/utility/**.hpp", "external/injector/kananlib/src/**.cpp" }
files { "external/injector/bddisasm/bddisasm/*.c" }
files { "external/injector/bddisasm/bdshemu/*.c" }
includedirs { "external/injector/kananlib/include" }
includedirs { "external/injector/bddisasm/inc" }
includedirs { "external/injector/bddisasm/bddisasm/include" }
end
filter "architecture:x32"
includedirs { "source/dxsdk" }
libdirs { "source/dxsdk/lib/x86" }
includedirs { "source/dxsdk/dx8" }
libdirs { "source/dxsdk/dx8" }
filter "architecture:x64"
includedirs { "source/dxsdk" }
libdirs { "source/dxsdk/lib/x64" }
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
staticruntime "On"
project "Driv3r.XboxRainDroplets"
setpaths("Z:/WFP/Games/Driv3r/", "driv3r.exe")
project "DriverParallelLines.XboxRainDroplets"
setpaths("Z:/WFP/Games/Driver Parallel Lines/", "DriverParallelLines.exe")
project "NFSUnderground2.XboxRainDroplets"
setpaths("Z:/WFP/Games/Need For Speed/Need for Speed Underground 2/", "speed2.exe")
project "NFSMostWanted.XboxRainDroplets"
setpaths("Z:/WFP/Games/Need For Speed/Need for Speed Most Wanted/", "speed.exe")
project "NFSCarbon.XboxRainDroplets"
setpaths("Z:/WFP/Games/Need For Speed/Need for Speed Carbon/", "NFSC.exe")
project "GTAIV.XboxRainDroplets"
setpaths("Z:/WGTA/IV/Episodes from Liberty City/", "EFLC.exe", "plugins/")
project "Mafia.XboxRainDroplets"
setpaths("Z:/WFP/Games/Mafia/", "GameV12.exe")
project "Scarface.XboxRainDroplets"
prebuildcommands {
"for /R \"../source/resources/shaders/ps/\" %%f in (*.hlsl) do (\"../source/dxsdk/lib/x86/fxc.exe\" /T ps_3_0 /nologo /E main /Fo \"../source/resources/%%~nf.cso\" %%f)",
"for /R \"../source/resources/shaders/vs/\" %%f in (*.hlsl) do (\"../source/dxsdk/lib/x86/fxc.exe\" /T vs_3_0 /nologo /E main /Fo \"../source/resources/%%~nf.cso\" %%f)",
}
setpaths("Z:/WFP/Games/Scarface/", "Scarface.exe")
project "Manhunt.XboxRainDroplets"
setpaths("Z:/WFP/Games/Manhunt/", "manhunt.exe", "scripts/")
project "MaxPayne.XboxRainDroplets"
setpaths("Z:/WFP/Games/Max Payne/Max Payne/", "MaxPayne.exe", "scripts/")
project "MaxPayne2.XboxRainDroplets"
setpaths("Z:/WFP/Games/Max Payne/Max Payne 2 The Fall of Max Payne/", "MaxPayne2.exe", "scripts/")
project "MaxPayne3.XboxRainDroplets"
setpaths("E:/Games/Steam/steamapps/common/Max Payne 3/Max Payne 3/", "MaxPayne3.exe", "plugins/")
project "SplinterCellBlacklist.XboxRainDroplets"
setpaths("Z:/WFP/Games/Splinter Cell/Splinter Cell Blacklist/src/SYSTEM/", "Blacklist_DX11_game.exe", "scripts/")
project "GTASADE.XboxRainDroplets"
architecture "x64"
add_kananlib()
setpaths("Z:/WFP/Games/Grand Theft Auto The Definitive Edition/GTA San Andreas - Definitive Edition/", "Gameface/Binaries/Win64/SanAndreas.exe", "Gameface/Binaries/Win64/scripts/")
project "GTAVCDE.XboxRainDroplets"
architecture "x64"
add_kananlib()
setpaths("Z:/WFP/Games/Grand Theft Auto The Definitive Edition/GTA Vice City - Definitive Edition/", "Gameface/Binaries/Win64/ViceCity.exe", "Gameface/Binaries/Win64/scripts/")
project "GTA3DE.XboxRainDroplets"
architecture "x64"
add_kananlib()
setpaths("Z:/WFP/Games/Grand Theft Auto The Definitive Edition/GTA III - Definitive Edition/", "Gameface/Binaries/Win64/LibertyCity.exe", "Gameface/Binaries/Win64/scripts/")
--tests
--project "GTA3.XboxRainDroplets"
-- setpaths("Z:/WFP/Games/Grand Theft Auto/GTAIII/", "gta3.exe", "scripts/")
--project "GTASA.XboxRainDroplets"
-- setpaths("Z:/WFP/Games/Grand Theft Auto/GTA San Andreas/", "gta_sa.exe", "scripts/")
workspace "XboxRainDropletsWrapper"
configurations { "Release", "Debug" }
platforms { "Win32", "x64" }
location "build"
objdir ("build/obj")
buildlog ("build/log/%{prj.name}.log")
cppdialect "C++latest"
kind "SharedLib"
language "C++"
targetextension ".asi"
characterset ("Unicode")
staticruntime "On"
defines { "rsc_CompanyName=\"ThirteenAG\"" }
defines { "rsc_LegalCopyright=\"MIT License\""}
defines { "rsc_FileVersion=\"1.0.0.0\"", "rsc_ProductVersion=\"1.0.0.0\"" }
defines { "rsc_InternalName=\"%{prj.name}\"", "rsc_ProductName=\"%{prj.name}\"", "rsc_OriginalFilename=\"XboxRainDroplets.asi\"" }
defines { "rsc_FileDescription=\"https://thirteenag.github.io/wfp\"" }
defines { "rsc_UpdateUrl=\"https://github.com/ThirteenAG/%{prj.name}\"" }
files { "source/%{prj.name}.cpp" }
files { "source/*.def" }
files { "source/resources/Versioninfo.rc" }
files { "source/resources/Dropmask.rc" }
files { "external/hooking/Hooking.Patterns.h", "external/hooking/Hooking.Patterns.cpp" }
files { "external/injector/safetyhook/include/**.hpp", "external/injector/safetyhook/src/**.cpp" }
files { "external/injector/zydis/**.h", "external/injector/zydis/**.c" }
includedirs { "source" }
includedirs { "external" }
includedirs { "external/hooking" }
includedirs { "external/injector/include" }
includedirs { "external/injector/safetyhook/include" }
includedirs { "external/injector/zydis" }
includedirs { "external/FusionDxHook/includes" }
includedirs { "external/sire" }
includedirs { "source/dxsdk/dx8" }
libdirs { "source/dxsdk/dx8" }
files { "external/sire/sire.h" }
filter "configurations:Debug"
defines "DEBUG"
symbols "On"
filter "configurations:Release"
defines "NDEBUG"
optimize "On"
filter "platforms:Win32"
architecture "x32"
includedirs { "source/dxsdk" }
libdirs { "source/dxsdk/lib/x86" }
filter "platforms:x64"
architecture "x64"
targetname "%{prj.name}64"
includedirs { "source/dxsdk" }
libdirs { "source/dxsdk/lib/x64" }
project "XboxRainDropletsWrapper"
setpaths("Z:/WFP/Games/PPSSPP/", "PPSSPPWindows.exe")
project "PPSSPP.XboxRainDroplets"
setpaths("Z:/WFP/Games/PPSSPP/", "PPSSPPWindows.exe")
project "PCSX2F.XboxRainDroplets"
setpaths("Z:/GitHub/PCSX2-Fork-With-Plugins/bin/", "pcsx2-qtx64-clang.exe")