Skip to content

Commit 52f284d

Browse files
committed
chore: update premake5 settings
1 parent 4187390 commit 52f284d

4 files changed

Lines changed: 25 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/msvc-gtasa/
88
/nbproject/
99
/release/
10-
10+
/premake5.exe
1111

1212

1313
#################

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ Still not sure? Check out [this](https://www.youtube.com/watch?v=TvRpQa8dJ7E) ni
1010

1111
Requirements:
1212

13-
+ [Premake 5](http://industriousone.com/premake/download) *(pre-built executable available in this repository root)*
14-
+ [Visual Studio](http://www.visualstudio.com/downloads) 2013 or greater.
13+
+ [Premake 5](https://premake.github.io/download/) *(install with `winget install -e --id Premake.Premake.5.Beta`, or download from the official website)*
14+
+ [Visual Studio](https://www.visualstudio.com/downloads) 2017 or greater.
15+
+ [Windows XP Platform Toolset](https://learn.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp) is required; add it from Visual Studio’s Individual Components Installer if needed.
1516

1617
Run the following command in the root of this directory to generate the project files:
1718

18-
premake5 vs2013
19+
premake5 vs2022
1920

2021
You can install the generated binaries into your game directory by running:
2122

2223
premake5 install "C:/Program Files (x86)/Rockstar Games/GTA San Andreas"
2324

24-
Or, you might want the files to be automatically installed everytime you build the solution:
25+
Or, you might want the files to be automatically installed every time you build the solution:
2526

26-
premake5 vs2013 "--idir=C:/Program Files (x86)/Rockstar Games/GTA San Andreas"
27-
27+
premake5 vs2022 "--idir=C:/Program Files (x86)/Rockstar Games/GTA San Andreas"

premake5.exe

-928 KB
Binary file not shown.

premake5.lua

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ newaction {
5959
Install Functionality
6060
--]]
6161
install_files = {}
62-
cmd_copyfile = os.is("windows") and { "xcopy", "/f /y /i" } or { "cp", "-v" }
63-
cmd_copydir = os.is("windows") and { "xcopy", "/e /f /y /i" } or { "cp", "-vr" }
62+
cmd_copyfile = os.ishost("windows") and { "xcopy", "/f /y /i" } or { "cp", "-v" }
63+
cmd_copydir = os.ishost("windows") and { "xcopy", "/e /f /y /i" } or { "cp", "-vr" }
6464

6565
-- Gets the install command for the specified file
6666
function installcommand(file, destdir)
@@ -164,11 +164,11 @@ function dummyproject()
164164
flags { "NoPCH" }
165165

166166
-- Dummy cpp file for Premake's generated none project (bug workaround)
167-
configuration "gmake"
167+
filter "action:gmake*"
168168
kind "StaticLib"
169169
files { "src/shared/dummy.cpp" }
170170

171-
configuration {}
171+
filter {}
172172
end
173173

174174
--[[
@@ -184,10 +184,10 @@ solution "modloader"
184184
targetprefix "" -- no 'lib' prefix on gcc
185185
targetdir "bin"
186186
implibdir "bin"
187+
staticruntime "On"
188+
symbols "On" -- Produce symbols whenever possible for logging purposes
187189

188190
flags {
189-
"StaticRuntime",
190-
"Symbols", -- Produce symbols whenever possible for logging purposes
191191
"NoImportLib", -- Mod Loader itself and it's plugins are dlls which exports some funcs but a implib isn't required
192192
--"NoRTTI", (std.data uses it now on handling.cpp)
193193
"NoBufferSecurityCheck"
@@ -214,26 +214,23 @@ solution "modloader"
214214
"src/shared",
215215
}
216216

217-
configuration "Debug*"
218-
flags { "Symbols" }
217+
filter "configurations:Debug*"
218+
symbols "On"
219219

220-
configuration "Release*"
220+
filter "configurations:Release*"
221221
defines { "NDEBUG" }
222222
optimize "Speed"
223223

224-
configuration "gmake"
224+
filter "action:gmake*"
225225
buildoptions { "-std=gnu++14", "-Wno-deprecated" }
226-
configuration "vs*"
226+
227+
-- Visual Studio 2017+ (v141_xp)
228+
filter "action:vs*"
229+
toolset "v141_xp"
227230
buildoptions { "/arch:IA32" } -- disable the use of SSE/SSE2 instructions (old game, old computers)
228231
buildoptions { "/Zm250", "/bigobj" } -- gta3.std.data is a monster
229-
230-
configuration "vs2012"
231-
toolset "v110_xp"
232-
configuration "vs2013"
233-
toolset "v120_xp"
234-
configuration "vs2015"
235-
toolset "v140_xp"
236-
buildoptions { "/Zc:threadSafeInit-" }
232+
buildoptions { "/Zc:threadSafeInit-" } -- threadSafeInit not available in WinXP
233+
filter {}
237234

238235
project "docs"
239236
dummyproject()
@@ -272,8 +269,9 @@ solution "modloader"
272269
project "shared"
273270
dummyproject()
274271
setupfiles "src/shared"
275-
configuration { "gmake" }
272+
filter "action:gmake*"
276273
includedirs { "src/shared/stdinc" } -- gmake compatibility since it'll compile the dummyproject
274+
filter {}
277275

278276

279277
local gta3_plugins = { -- ordered by time taken to compile

0 commit comments

Comments
 (0)