-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake5.lua
81 lines (70 loc) · 2.72 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
workspace "MemoryOperations"
platforms { "Windows" }
configurations { "Release", "Debug" }
location "build"
objdir ("build/obj")
buildlog ("build/log/%{prj.name}.log")
buildoptions {"-std:c++latest"}
kind "SharedLib"
language "C++"
targetdir "data/%{prj.name}/cleo/cleo_plugins"
targetextension ".cleo"
characterset ("UNICODE")
staticruntime "On"
defines { "rsc_CompanyName=\"CompanyName\"" }
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}.cleo\"" }
defines { "rsc_FileDescription=\"FileDescription\"" }
defines { "rsc_UpdateUrl=\"UpdateUrl\"" }
files { "source/*.cpp" }
files { "resources/*.rc" }
files { "external/hooking/Hooking.Patterns.h", "external/hooking/Hooking.Patterns.cpp" }
includedirs { "external/hooking" }
includedirs { "external/modutils" }
includedirs { "sdk" }
libdirs { "sdk" }
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 ("data/%{prj.name}/" .. scriptspath)
end
function add_asmjit()
files { "external/asmjit/src/**.cpp" }
includedirs { "external/asmjit/src" }
end
filter "configurations:Debug*"
defines "DEBUG"
symbols "On"
filter "configurations:Release*"
defines "NDEBUG"
optimize "On"
project "MemoryOperations"
architecture "x32"
links { "cleo_redux.lib" }
setpaths("E:/Games/Steam/steamapps/common/Grand Theft Auto IV/GTAIV/", "GTAIV.exe", "plugins/cleo/cleo_plugins/")
project "MemoryOperations64"
architecture "x64"
links { "cleo_redux64.lib" }
--add_asmjit()
setpaths("Z:/WFP/Games/Grand Theft Auto The Definitive Edition/GTA San Andreas - Definitive Edition/", "Gameface/Binaries/Win64/SanAndreas.exe", "Gameface/Binaries/Win64/cleo/cleo_plugins/")