Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
106 lines (85 loc) · 2.63 KB
/
Copy pathpremake5.lua
File metadata and controls
106 lines (85 loc) · 2.63 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
-- Premake Project Generator for III.VC.SA.WebView2
local XBASE_LIB_DIR = "lib"
workspace "WebView2"
configurations { "Debug", "Release" }
architecture "x86"
platforms "Win32"
language "C++"
cppdialect "C++20"
characterset "MBCS"
staticruntime "On"
location "build"
targetdir "build/bin"
toolset "msc"
buildoptions { "/utf-8", "/FS" }
defines {
"IS_PLATFORM_WIN",
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS"
}
function configureBuildMode()
filter "configurations:Debug"
symbols "On"
defines { "DEBUG" }
filter "configurations:Release"
optimize "On"
defines { "NDEBUG" }
filter {}
end
-- 载荷命名与宿主 ASI 名解耦,loader 导出基名 WebView2
-- 主 ASI 仍叫 III.VC.SA.WebView2.asi,载荷是 WebView2\WebView2SA.dll
local PAYLOAD_BASE = "WebView2"
function createPayloadProject(projectID)
local upperID = string.upper(projectID)
local gameDefine = upperID == "III" and "GTA3" or "GTA" .. upperID
local pluginName = upperID == "III" and "PluginIII" or "Plugin" .. upperID
project ("WebView2Payload" .. upperID)
kind "SharedLib"
targetname (PAYLOAD_BASE .. upperID)
targetextension ".dll"
targetdir "build/bin/XBase/Mods/WebView2"
includedirs {
"include",
"src"
}
files {
"src/**.h",
"src/**.hpp",
"src/**.c",
"src/**.cpp",
"src/**.rc",
"include/XBase/**.h"
}
if upperID ~= "SA" then
removefiles { "src/**_sa.c", "src/**_sa.hpp", "src/**_sa.cpp" }
end
if upperID ~= "VC" then
removefiles { "src/**_vc.c", "src/**_vc.hpp", "src/**_vc.cpp" }
end
if upperID ~= "III" then
removefiles { "src/**_iii.c", "src/**_iii.hpp", "src/**_iii.cpp" }
end
defines { gameDefine }
libdirs { XBASE_LIB_DIR }
links { "XBase" .. upperID, pluginName, "XBasePayloadEntry" }
linkoptions { "/WHOLEARCHIVE:XBasePayloadEntry.lib" }
configureBuildMode()
end
function createLoaderProject()
project "WebView2"
kind "SharedLib"
targetname (PAYLOAD_BASE)
targetextension ".asi"
files {
"loader/**.h",
"loader/**.cpp"
}
libdirs { XBASE_LIB_DIR }
links { "XBaseBootstrap" }
linkoptions { "/WHOLEARCHIVE:XBaseBootstrap.lib" }
configureBuildMode()
end
createPayloadProject("sa")
createPayloadProject("vc")
createPayloadProject("iii")
createLoaderProject()