Files
yugioh-legacy-engine/server/gframe/premake5.lua
T
donnyandClaude Fable 5.1 da27435cdb server: import the duel server (nanahira/ygopro server at 52c868ce)
The server tree of https://code.moenext.com/nanahira/ygopro.git, branch
server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/,
premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps
them in resource/ and copies them in before building). No game assets, no
scripts, no ocgcore submodule: the core is ../core.

The third-party sources upstream's Windows CI downloads are vendored here
at the positions its premake expects, each with its premake fragment from
upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent
2.1.13-stable (tests, samples and autotools helpers left out; the files
its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib
and examples left out), xz 5.8.3 (src/liblzma + src/common only), and
irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht
headers and the 11 .cpp files the server's zip reader project compiles.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:21 -07:00

148 lines
4.4 KiB
Lua

if SERVER_MODE then
if SERVER_PRO3_SUPPORT then
project "ygoserver"
kind "SharedLib"
else
project "ygopro"
kind "ConsoleApp"
end
cppdialect "C++14"
defines { "YGOPRO_SERVER_MODE" }
files {
"gframe.cpp", "config.h",
"game.cpp", "game.h", "file_system.cpp", "file_system.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"
}
if SERVER_PRO3_SUPPORT then
files { "gframe.h", "serverapi.cpp", "serverapi.h" }
defines { "SERVER_PRO3_SUPPORT" }
end
if SERVER_ZIP_SUPPORT then
defines { "SERVER_ZIP_SUPPORT", "_IRR_STATIC_LIB_" }
if BUILD_IRRLICHT then
includedirs { "../irrlicht/source/Irrlicht" }
end
end
if SERVER_PRO2_SUPPORT then
defines { "SERVER_PRO2_SUPPORT" }
end
if SERVER_TAG_SURRENDER_CONFIRM then
defines { "SERVER_TAG_SURRENDER_CONFIRM" }
end
else
project "YGOPro"
kind "WindowedApp"
rtti "Off"
if USE_OPENMP then
openmp "On"
end
defines { "_IRR_STATIC_LIB_" }
files {
"*.cpp", "*.h",
"CGUISkinSystem/*.cpp", "CGUISkinSystem/*.h",
"CXMLRegistry/*.cpp", "CXMLRegistry/*.h"
}
end
includedirs { "../ocgcore" }
links { "ocgcore" }
for _, dep in ipairs(DEPENDENCIES_METADATA) do
if DependencyEnabled(dep) and (dep.name ~= "lua" or not OCGCORE_DYNAMIC) then
local upper = string.upper(dep.name)
if dep.name == "freetype" and BUILD_FREETYPE then
-- Add custom include directory for FreeType before the default include directory.
includedirs { FREETYPE_CUSTOM_INCLUDE_DIR }
end
includedirs { _G[upper .. "_INCLUDE_DIR"] }
if _G["BUILD_" .. upper] then
-- Source-built dependencies are linked by their Premake project names.
links { dep.name }
else
links { _G[upper .. "_LIB_NAME"] }
libdirs { _G[upper .. "_LIB_DIR"] }
end
end
end
if not BUILD_EVENT and not os.istarget("windows") then
links { EVENT_PTHREADS_LIB_NAME }
end
if not SERVER_MODE then
if USE_SIMD == "none" then
defines { "STBIR_NO_SIMD" }
end
if USE_AUDIO then
defines { "YGOPRO_USE_AUDIO" }
if AUDIO_LIB == "miniaudio" then
defines { "YGOPRO_USE_MINIAUDIO" }
includedirs { MINIAUDIO_INCLUDE_DIR }
links { "miniaudio" }
if MINIAUDIO_SUPPORT_OPUS_VORBIS then
defines { "YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS" }
includedirs { MINIAUDIO_OPUS_INCLUDE_DIR, MINIAUDIO_VORBIS_INCLUDE_DIR }
if not MINIAUDIO_BUILD_OPUS_VORBIS then
links { OPUSFILE_LIB_NAME, VORBISFILE_LIB_NAME, OPUS_LIB_NAME, VORBIS_LIB_NAME, OGG_LIB_NAME }
libdirs { OPUSFILE_LIB_DIR, OPUS_LIB_DIR, VORBIS_LIB_DIR, OGG_LIB_DIR }
end
end
end
end
end
filter "system:windows"
if not SERVER_PRO3_SUPPORT then
entrypoint "mainCRTStartup"
end
files "ygopro.rc"
defines { "NOMINMAX=1", "WIN32_LEAN_AND_MEAN" }
if SERVER_PRO2_SUPPORT and not SERVER_PRO3_SUPPORT then
targetname "AI.Server"
end
if SERVER_MODE then
links { "ws2_32", "iphlpapi" }
else
links { "ws2_32", "Dnsapi", "iphlpapi", "winmm" }
end
if not SERVER_MODE then
filter "not system:windows"
links { "resolv" }
end
filter "not action:vs*"
cppdialect "C++14"
filter "system:macosx"
if not SERVER_MODE then
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework", "Carbon.framework" }
defines { "GL_SILENCE_DEPRECATION" }
end
filter "system:linux"
links { "dl", "pthread" }
if not SERVER_MODE then
links { "GL", "X11" }
if USE_OPENMP then
linkoptions { "-fopenmp" }
end
end
if USE_DYNAMIC then
linkoptions { "-Wl,-rpath=./" }
else
linkoptions { "-static-libstdc++", "-static-libgcc" }
end