Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
117 lines (95 loc) · 2.71 KB
/
Copy pathpremake5.lua
File metadata and controls
117 lines (95 loc) · 2.71 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
107
108
109
110
111
112
113
114
115
116
117
-- Premake Project Generator for XMenu
local XBASE_LIB_DIR = "lib"
workspace "XMenu"
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
function createModProject(projectID)
local upperID = string.upper(projectID)
local gameDefine = upperID == "III" and "GTA3" or "GTA" .. upperID
project ("XMenu" .. upperID)
kind "SharedLib"
targetname ("XMenu" .. upperID)
targetextension ".asi"
targetdir "build/bin"
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 }
if projectID == "sa" then
links { "XBaseModEntry", "XBaseSA", "PluginSA" }
elseif projectID == "vc" then
links { "XBaseModEntry", "XBaseVC", "PluginVC" }
else
links { "XBaseModEntry", "XBaseIII", "PluginIII" }
end
linkoptions { "/WHOLEARCHIVE:XBaseModEntry.lib" }
configureBuildMode()
end
function createInstallerProject()
project "XMenuInstaller"
kind "WindowedApp"
targetname "XMenuInstaller"
targetextension ".exe"
files {
"installer/**.h",
"installer/**.cpp",
"installer/**.rc"
}
removefiles {
"installer/Ui.cpp"
}
-- 仅由 main.cpp #include,禁止作为独立 TU 编译。
removefiles { "installer/_ui_rewrite_tail.cpp" }
links {
"urlmon",
"shell32",
"ole32"
}
configureBuildMode()
end
createModProject("sa")
createModProject("vc")
createModProject("iii")
createInstallerProject()