Skip to content

Commit c65b97f

Browse files
committed
macOS: rename MTA_LIB_EXTENSION to .dylib
Also add net build support to install_data.lua
1 parent 0db1c3d commit c65b97f

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

Server/mods/deathmatch/logic/CPerfStat.LibMemory.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ void CPerfStatLibMemoryImpl::GetLibMemoryStats(CPerfStatResult* pResult, const s
218218
#endif
219219
#ifdef WIN32
220220
info.strName += ".dll";
221+
#elif defined(__APPLE__)
222+
info.strName += ".dylib";
221223
#else
222224
info.strName += ".so";
223225
#endif

Server/sdk/MTAPlatform.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" bool g_bNoTopBar;
3434
#define MTA_LIB_EXTENSION ".so"
3535
#elif defined(__APPLE__)
3636
#define MTA_OS_STRING "macOS"
37-
#define MTA_LIB_EXTENSION ".so"
37+
#define MTA_LIB_EXTENSION ".dylib"
3838
#else
3939
#error "Unsupported operating system"
4040
#endif
@@ -82,7 +82,7 @@ typedef int socklen_t;
8282
#include <ncurses.h>
8383
#elif __has_include(<ncursesw/curses.h>)
8484
#include <ncursesw/curses.h>
85-
#else
85+
#else
8686
#include <ncurses.h>
8787
#endif
8888

linux-install-data.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

3-
PREMAKE5=utils/premake5
3+
# Find premake binary location
4+
if [ "$(uname)" == "Darwin" ]; then
5+
PREMAKE5=utils/premake5-macos
6+
else
7+
PREMAKE5=utils/premake5
8+
fi
49

510
# Install data files
611
$PREMAKE5 install_data

utils/buildactions/install_data.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ local NETC_PATH_WIN = "https://mirror.mtasa.com/bdata/netc.dll"
1313
local NET_PATH_X86_LINUX = "https://mirror.mtasa.com/bdata/net.so"
1414
local NET_PATH_X64_LINUX = "https://mirror.mtasa.com/bdata/net_64.so"
1515

16+
local NET_PATH_X64_MACOS = "https://mirror.mtasa.com/bdata/net.dylib"
17+
1618
newaction {
1719
trigger = "install_data",
1820
description = "Installs data files",
@@ -32,7 +34,7 @@ newaction {
3234

3335
-- Make sure server/x64 directory exists
3436
os.mkdir(BIN_DIR.."/server/x64")
35-
37+
3638
if os.host() == "windows" then
3739
http.download_print_errors(NET_PATH_X86_WIN, BIN_DIR.."/server/net.dll")
3840
http.download_print_errors(NET_PATH_X64_WIN, BIN_DIR.."/server/x64/net.dll")
@@ -41,6 +43,13 @@ newaction {
4143
os.copyfile(BIN_DIR.."/MTA/netc.dll", BIN_DIR.."/MTA/netc_d.dll")
4244
os.copyfile(BIN_DIR.."/server/net.dll", BIN_DIR.."/server/net_d.dll")
4345
os.copyfile(BIN_DIR.."/server/x64/net.dll", BIN_DIR.."/server/x64/net_d.dll")
46+
elseif os.host() == "macosx" then
47+
local c = string.char(27)
48+
print(string.format("Listen, I ain't leaving here till you tell me where the macOS net builds are.\n " ..
49+
" So come on bub, for old times' sake, huh?\n\t%s[45m%s[37mDid you just call me... BLOB?%s[0m\n", c,c,c,c))
50+
51+
http.download_print_errors(NET_PATH_X64_MACOS, BIN_DIR.."/server/x64/net.dylib")
52+
os.copyfile(BIN_DIR.."/server/x64/net.dylib", BIN_DIR.."/server/x64/net_d.dylib")
4453
else
4554
http.download_print_errors(NET_PATH_X86_LINUX, BIN_DIR.."/server/net.so")
4655
http.download_print_errors(NET_PATH_X64_LINUX, BIN_DIR.."/server/x64/net.so")

0 commit comments

Comments
 (0)