Commit f83e4b14 authored by mercury233's avatar mercury233

server mode

parent ce936269
include "lzma/."
if not SERVER_MODE then
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"
files { "*.cpp", "*.h" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" }
end
if BUILD_EVENT then
includedirs { "../event/include" }
......@@ -47,7 +66,9 @@ project "YGOPro"
filter "system:windows"
defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc"
if not SERVER_MODE then
libdirs { "$(DXSDK_DIR)Lib/x86" }
end
if USE_IRRKLANG then
links { "irrKlang" }
if IRRKLANG_PRO then
......@@ -60,14 +81,20 @@ project "YGOPro"
filter {}
end
end
if SERVER_MODE then
links { "ws2_32" }
else
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
end
filter "not action:vs*"
buildoptions { "-std=c++14", "-fno-rtti" }
filter "not system:windows"
links { "event_pthreads", "dl", "pthread" }
filter "system:macosx"
if not SERVER_MODE then
links { "z" }
defines { "GL_SILENCE_DEPRECATION" }
end
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" }
......@@ -76,7 +103,9 @@ project "YGOPro"
links { "irrklang" }
end
filter "system:linux"
if not SERVER_MODE then
links { "GL", "X11", "Xxf86vm" }
end
if USE_IRRKLANG then
links { "IrrKlang" }
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
IRRKLANG_PRO = false
LUA_LIB_NAME = "lua"
SERVER_MODE = true
USE_IRRKLANG = false
-- read settings from command line or environment variables
newoption { trigger = "build-lua", category = "YGOPro - lua", description = "" }
......@@ -49,6 +52,7 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption { trigger = "winxp-support", category = "YGOPro", description = "" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" }
newoption { trigger = "server-mode", category = "YGOPro", description = "" }
function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
......@@ -147,6 +151,9 @@ end
if GetParam("mac-arm") and os.istarget("macosx") then
MAC_ARM = true
end
if GetParam("server-mode") then
SERVER_MODE = true
end
workspace "YGOPro"
location "build"
......@@ -157,7 +164,9 @@ workspace "YGOPro"
filter "system:windows"
defines { "WIN32", "_WIN32" }
if not SERVER_MODE then
entrypoint "mainCRTStartup"
end
systemversion "latest"
startproject "YGOPro"
if WINXP_SUPPORT then
......@@ -173,7 +182,9 @@ workspace "YGOPro"
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
end
if not SERVER_MODE then
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
end
filter "system:linux"
buildoptions { "-U_FORTIFY_SOURCE" }
......@@ -221,15 +232,15 @@ workspace "YGOPro"
if BUILD_EVENT then
include "event"
end
if BUILD_FREETYPE then
if BUILD_FREETYPE and not SERVER_MODE then
include "freetype"
end
if BUILD_IRRLICHT then
if BUILD_IRRLICHT and not SERVER_MODE then
include "irrlicht"
end
if BUILD_SQLITE then
include "sqlite3"
end
if USE_IRRKLANG and IRRKLANG_PRO then
if USE_IRRKLANG and IRRKLANG_PRO and not SERVER_MODE then
include "ikpmp3"
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