Commit f83e4b14 authored by mercury233's avatar mercury233

server mode

parent ce936269
include "lzma/." include "lzma/."
if not SERVER_MODE then
include "spmemvfs/." include "spmemvfs/."
end
project "YGOPro" project "ygopro"
if SERVER_MODE then
kind "ConsoleApp"
defines { "YGOPRO_SERVER_MODE" }
files { "gframe.cpp", "config.h",
"game.cpp", "game.h", "myfilesystem.h",
"deck_manager.cpp", "deck_manager.h",
"data_manager.cpp", "data_manager.h",
"replay.cpp", "replay.h",
"netserver.cpp", "netserver.h",
"single_duel.cpp", "single_duel.h",
"tag_duel.cpp", "tag_duel.h" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", LUA_LIB_NAME, "sqlite3", "event" }
else
kind "WindowedApp" kind "WindowedApp"
files { "*.cpp", "*.h" } files { "*.cpp", "*.h" }
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" } links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" }
end
if BUILD_EVENT then if BUILD_EVENT then
includedirs { "../event/include" } includedirs { "../event/include" }
...@@ -47,7 +66,9 @@ project "YGOPro" ...@@ -47,7 +66,9 @@ project "YGOPro"
filter "system:windows" filter "system:windows"
defines { "_IRR_WCHAR_FILESYSTEM" } defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc" files "ygopro.rc"
if not SERVER_MODE then
libdirs { "$(DXSDK_DIR)Lib/x86" } libdirs { "$(DXSDK_DIR)Lib/x86" }
end
if USE_IRRKLANG then if USE_IRRKLANG then
links { "irrKlang" } links { "irrKlang" }
if IRRKLANG_PRO then if IRRKLANG_PRO then
...@@ -60,14 +81,20 @@ project "YGOPro" ...@@ -60,14 +81,20 @@ project "YGOPro"
filter {} filter {}
end end
end end
if SERVER_MODE then
links { "ws2_32" }
else
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" } links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
end
filter "not action:vs*" filter "not action:vs*"
buildoptions { "-std=c++14", "-fno-rtti" } buildoptions { "-std=c++14", "-fno-rtti" }
filter "not system:windows" filter "not system:windows"
links { "event_pthreads", "dl", "pthread" } links { "event_pthreads", "dl", "pthread" }
filter "system:macosx" filter "system:macosx"
if not SERVER_MODE then
links { "z" } links { "z" }
defines { "GL_SILENCE_DEPRECATION" } defines { "GL_SILENCE_DEPRECATION" }
end
if MAC_ARM then if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" } buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" } linkoptions { "-arch arm64" }
...@@ -76,7 +103,9 @@ project "YGOPro" ...@@ -76,7 +103,9 @@ project "YGOPro"
links { "irrklang" } links { "irrklang" }
end end
filter "system:linux" filter "system:linux"
if not SERVER_MODE then
links { "GL", "X11", "Xxf86vm" } links { "GL", "X11", "Xxf86vm" }
end
if USE_IRRKLANG then if USE_IRRKLANG then
links { "IrrKlang" } links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH } linkoptions{ IRRKLANG_LINK_RPATH }
......
project "event"
kind "StaticLib"
includedirs { "include", "compat" }
files { "event.c", "evthread.c", "buffer.c", "bufferevent.c", "bufferevent_sock.c",
"bufferevent_filter.c", "bufferevent_pair.c", "listener.c", "bufferevent_ratelim.c",
"evmap.c", "log.c", "evutil.c", "evutil_rand.c", "strlcpy.c", "signal.c",
"event_tagging.c", "http.c", "evdns.c", "evrpc.c" }
configuration "windows"
files { "win32select.c", "evthread_win32.c", "buffer_iocp.c", "event_iocp.c", "bufferevent_async.c" }
project "lua"
kind "StaticLib"
files { "*.c", "*.cpp", "*.h", "*.hpp" }
removefiles { "lua.c", "luac.c" }
configuration "vs*"
buildoptions { "/TP" }
project "sqlite3"
kind "StaticLib"
files { "sqlite3.c", "sqlite3.h" }
...@@ -9,6 +9,9 @@ USE_IRRKLANG = true ...@@ -9,6 +9,9 @@ USE_IRRKLANG = true
IRRKLANG_PRO = false IRRKLANG_PRO = false
LUA_LIB_NAME = "lua" LUA_LIB_NAME = "lua"
SERVER_MODE = true
USE_IRRKLANG = false
-- read settings from command line or environment variables -- read settings from command line or environment variables
newoption { trigger = "build-lua", category = "YGOPro - lua", description = "" } newoption { trigger = "build-lua", category = "YGOPro - lua", description = "" }
...@@ -49,6 +52,7 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan ...@@ -49,6 +52,7 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption { trigger = "winxp-support", category = "YGOPro", description = "" } newoption { trigger = "winxp-support", category = "YGOPro", description = "" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" } newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" }
newoption { trigger = "server-mode", category = "YGOPro", description = "" }
function GetParam(param) function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_"))) return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
...@@ -147,6 +151,9 @@ end ...@@ -147,6 +151,9 @@ end
if GetParam("mac-arm") and os.istarget("macosx") then if GetParam("mac-arm") and os.istarget("macosx") then
MAC_ARM = true MAC_ARM = true
end end
if GetParam("server-mode") then
SERVER_MODE = true
end
workspace "YGOPro" workspace "YGOPro"
location "build" location "build"
...@@ -157,7 +164,9 @@ workspace "YGOPro" ...@@ -157,7 +164,9 @@ workspace "YGOPro"
filter "system:windows" filter "system:windows"
defines { "WIN32", "_WIN32" } defines { "WIN32", "_WIN32" }
if not SERVER_MODE then
entrypoint "mainCRTStartup" entrypoint "mainCRTStartup"
end
systemversion "latest" systemversion "latest"
startproject "YGOPro" startproject "YGOPro"
if WINXP_SUPPORT then if WINXP_SUPPORT then
...@@ -173,7 +182,9 @@ workspace "YGOPro" ...@@ -173,7 +182,9 @@ workspace "YGOPro"
if MAC_ARM then if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" } buildoptions { "--target=arm64-apple-macos12" }
end end
if not SERVER_MODE then
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" } links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
end
filter "system:linux" filter "system:linux"
buildoptions { "-U_FORTIFY_SOURCE" } buildoptions { "-U_FORTIFY_SOURCE" }
...@@ -221,15 +232,15 @@ workspace "YGOPro" ...@@ -221,15 +232,15 @@ workspace "YGOPro"
if BUILD_EVENT then if BUILD_EVENT then
include "event" include "event"
end end
if BUILD_FREETYPE then if BUILD_FREETYPE and not SERVER_MODE then
include "freetype" include "freetype"
end end
if BUILD_IRRLICHT then if BUILD_IRRLICHT and not SERVER_MODE then
include "irrlicht" include "irrlicht"
end end
if BUILD_SQLITE then if BUILD_SQLITE then
include "sqlite3" include "sqlite3"
end end
if USE_IRRKLANG and IRRKLANG_PRO then if USE_IRRKLANG and IRRKLANG_PRO and not SERVER_MODE then
include "ikpmp3" include "ikpmp3"
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment