Skip to content

Commit

Permalink
Added post build commands for Windows x64 server
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Feb 12, 2017
1 parent 540d148 commit 2f30ef0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
9 changes: 4 additions & 5 deletions utils/buildactions/install_data.lua
Expand Up @@ -6,9 +6,8 @@ premake.modules.install_data = {}
local BIN_DIR = "Bin"
local DATA_DIR = "Shared/data/MTA San Andreas"

-- TODO
local NET_PATH_X86_WIN = "https://mirror.mtasa.com/bdata/net.dll"
--local NET_PATH_X64_WIN = "https://"
local NET_PATH_X64_WIN = "https://mirror.mtasa.com/bdata/net_64.dll"
local NETC_PATH_WIN = "https://mirror.mtasa.com/bdata/netc.dll"

local NET_PATH_X86_LINUX = "https://mirror.mtasa.com/bdata/net.so"
Expand All @@ -27,7 +26,7 @@ newaction {
os.copydir(DATA_DIR, BIN_DIR)
end

-- Copy configs
-- Copy configs if they don't already exist
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.conf", false, true)
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.xml", false, true)

Expand All @@ -36,12 +35,12 @@ newaction {

if os.get() == "windows" then
http.download(NET_PATH_X86_WIN, BIN_DIR.."/server/net.dll")
--http.download(NET_PATH_X64_WIN, BIN_DIR.."/server/x64/mods/net.dll")
http.download(NET_PATH_X64_WIN, BIN_DIR.."/server/x64/net.dll")
http.download(NETC_PATH_WIN, BIN_DIR.."/MTA/netc.dll")

os.copyfile(BIN_DIR.."/MTA/netc.dll", BIN_DIR.."/MTA/netc_d.dll")
os.copyfile(BIN_DIR.."/server/net.dll", BIN_DIR.."/server/net_d.dll")
--os.copyfile("/server/x64/net.dll", "/server/x64/net_d.dll")
os.copyfile(BIN_DIR.."/server/x64/net.dll", BIN_DIR.."/server/x64/net_d.dll")
else
http.download(NET_PATH_X86_LINUX, BIN_DIR.."/server/net.so")
http.download(NET_PATH_X64_LINUX, BIN_DIR.."/server/x64/net.so")
Expand Down
6 changes: 6 additions & 0 deletions vendor/curl/lib/premake5.lua
Expand Up @@ -269,6 +269,12 @@ project "curl"
"copy \"%{wks.location}..\\Bin\\server\\libcurl_d.dll\" \"%{wks.location}..\\Bin\\server\\libcurl.dll\""
}

filter {"system:windows", "platforms:x64", "configurations:Debug"}
postbuildcommands {
-- Fix net.dll requiring the release build
"copy \"%{wks.location}..\\Bin\\server\\x64\\libcurl_d.dll\" \"%{wks.location}..\\Bin\\server\\x64\\libcurl.dll\""
}

filter "platforms:x64"
targetdir(buildpath("server/x64"))

6 changes: 6 additions & 0 deletions vendor/pthreads/premake5.lua
Expand Up @@ -37,6 +37,12 @@ project "pthread"
"copy \"%{wks.location}..\\Bin\\server\\pthread_d.dll\" \"%{wks.location}..\\Bin\\mta\\pthread.dll\"",
"copy \"%{wks.location}..\\Bin\\server\\pthread_d.dll\" \"%{wks.location}..\\Bin\\server\\pthread.dll\""
}

filter {"system:windows", "platforms:x64", "configurations:Debug"}
postbuildcommands {
-- Fix net.dll requiring the release build
"copy \"%{wks.location}..\\Bin\\server\\x64\\pthread_d.dll\" \"%{wks.location}..\\Bin\\server\\x64\\pthread.dll\""
}

filter {"system:windows", "platforms:x64"}
targetdir(buildpath("server/x64"))
Expand Down

0 comments on commit 2f30ef0

Please sign in to comment.