Skip to content

Commit 61b819b

Browse files
committed
Make amx (pawn) a separate project
1 parent e374a2b commit 61b819b

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

amx-deps/src/amx/premake5.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
local amxfiles = {
2+
"amx.c",
3+
"amxaux.c",
4+
"amxcons.c",
5+
"amxcore.c",
6+
"amxfile.c",
7+
"amxstring.c",
8+
"amxtime.c",
9+
"float.c",
10+
}
11+
12+
project "amx"
13+
language "C++"
14+
kind "StaticLib"
15+
16+
defines {
17+
-- From original project, but causes crashes?
18+
-- "AMX_DONT_RELOCATE"
19+
}
20+
21+
filter "system:windows"
22+
-- "__WIN32__" needed for amx
23+
defines { "__WIN32__" }
24+
25+
vpaths {
26+
["Headers/*"] = "**.h",
27+
["Sources/*"] = amxfiles,
28+
}
29+
30+
files {
31+
amxfiles,
32+
}
33+
34+
filter "system:windows"
35+
links { "winmm" }

amx-deps/src/premake5.lua

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
local amxfiles = {
2-
"amx/amx.c",
3-
"amx/amxaux.c",
4-
"amx/amxcons.c",
5-
"amx/amxcore.c",
6-
"amx/amxfile.c",
7-
"amx/amxstring.c",
8-
"amx/amxtime.c",
9-
"amx/float.c",
10-
}
11-
121
solution "king"
132
configurations { "Debug", "Release" }
143
platforms { "x86", "x64" }
@@ -23,21 +12,19 @@ solution "king"
2312
defines {
2413
"_CRT_SECURE_NO_WARNINGS",
2514
"HAVE_STDINT_H",
26-
27-
-- From original project, but causes crashes?
28-
-- "AMX_DONT_RELOCATE"
2915
}
3016

3117
filter "system:windows"
32-
-- "__WIN32__" needed for amx
33-
defines { "WINDOWS", "WIN32", "__WIN32__" }
18+
defines { "WINDOWS", "WIN32" }
3419

3520
filter "configurations:Debug"
3621
defines { "DEBUG" }
3722

3823
filter "configurations:Release"
3924
optimize "Speed"
4025

26+
include "amx"
27+
4128
project "ml_base"
4229
language "C++"
4330
kind "SharedLib"
@@ -47,8 +34,8 @@ solution "king"
4734
libdirs { "lib" }
4835

4936
vpaths {
50-
["Headers/*"] = "**.h",
51-
["Sources/*"] = {"**.cpp", amxfiles},
37+
["Headers/*"] = {"*.h", "include/*.h", "linux/*.h"},
38+
["Sources/*"] = {"**.cpp"},
5239
["Resources/*"] = "king.rc",
5340

5441
["*"] = "premake5.lua",
@@ -57,11 +44,15 @@ solution "king"
5744
files {
5845
"premake5.lua",
5946
"**.cpp",
60-
"**.h",
47+
"*.h",
48+
"include/*.h",
49+
"linux/*.h",
6150
"king.rc",
62-
amxfiles
6351
}
6452

53+
include "amx"
54+
links "amx"
55+
6556
filter {"system:linux", "platforms:x86" }
6657
linkoptions { "-Wl,-rpath=mods/deathmatch" }
6758

@@ -74,5 +65,5 @@ solution "king"
7465
filter "system:windows"
7566
links { "lua5.1", "sqlite3" }
7667

77-
-- for amx
78-
links { "winmm" }
68+
filter {}
69+
links "amx"

0 commit comments

Comments
 (0)