Commit 4a5f0253 authored by mercury233's avatar mercury233 Committed by GitHub

update build system to premake5 (#2399)

parent 55140448
.DS_Store
/deck
/expansions
/fonts
/icon
/pack
/pics
/replay
/single
/WindBot
/cards.cdb
/error.log
/bot.conf
/Bot.exe
/bot
/ygopro
/ygopro.exe
/ygopro.app
/bin
/build
/obj
/event
/freetype
/irrlicht
/irrklang
/ikpmp3
/lua
/sqlite3
/gframe/*.ico
/gframe/ygopro.rc
/gframe/ygopro.aps
/premake5
/premake5.exe
project "clzma"
kind "StaticLib"
files { "**.c", "**.h" }
files { "*.c", "*.h" }
......@@ -4,40 +4,69 @@ include "spmemvfs/."
project "ygopro"
kind "WindowedApp"
files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes { "lzma/**", "spmemvfs/**" }
files { "*.cpp", "*.h" }
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", "Irrlicht", "freetype", "sqlite3", "event" }
links { "ocgcore", "clzma", "cspmemvfs", "lua", "sqlite3", "irrlicht", "freetype", "event" }
configuration "windows"
if BUILD_EVENT then
includedirs { "../event/include" }
end
if BUILD_IRRLICHT or os.ishost("macosx") then
includedirs { "../irrlicht/include" }
end
if BUILD_FREETYPE then
includedirs { "../freetype/include" }
end
if BUILD_SQLITE then
includedirs { "../sqlite3" }
end
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
includedirs { "../irrklang/include" }
end
filter "system:windows"
defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc"
excludes "CGUIButton.cpp"
includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3" }
links { "lua" }
libdirs { "$(DXSDK_DIR)Lib/x86" }
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
links { "irrKlang" }
includedirs { "../irrklang/include" }
libdirs { "../irrklang/lib/Win32-visualStudio" }
if IRRKLANG_PRO then
defines { "IRRKLANG_STATIC" }
links { "ikpmp3" }
filter { "not configurations:Debug" }
libdirs { "../irrklang/lib/Win32-vs2019" }
filter { "configurations:Debug" }
libdirs { "../irrklang/lib/Win32-visualStudio-debug" }
filter {}
else
libdirs { "../irrklang/lib/Win32-visualStudio" }
end
end
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
configuration {"windows", "not vs*"}
filter { "system:windows", "not action:vs*"}
includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" }
configuration "not vs*"
filter "not action:vs*"
buildoptions { "-std=c++14", "-fno-rtti" }
configuration "not windows"
filter "not system:windows"
includedirs { "/usr/include/irrlicht", "/usr/include/freetype2" }
excludes { "COSOperator.*" }
links { "lua5.3-c++", "event_pthreads", "GL", "dl", "pthread" }
configuration "linux"
links { "event_pthreads", "dl", "pthread", "X11" }
filter "system:macosx"
libdirs { "../irrlicht/source/Irrlicht/MacOSX/build/Release/" }
links { "z" }
defines { "GL_SILENCE_DEPRECATION" }
if USE_IRRKLANG then
links { "irrklang" }
libdirs { "../irrklang/bin/macosx-gcc" }
end
filter "system:linux"
links { "GL", "Xxf86vm" }
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
links { "IrrKlang" }
linkoptions{ "-Wl,-rpath=./irrklang/bin/linux-gcc-64/" }
libdirs { "../irrklang/bin/linux-gcc-64" }
includedirs { "../irrklang/include" }
end
project "cspmemvfs"
kind "StaticLib"
files { "**.c", "**.h" }
files { "*.c", "*.h" }
configuration "windows"
if BUILD_SQLITE then
includedirs { "../../sqlite3" }
end
Subproject commit 16be11adb9cc82390d57d98f669e096c04f145f1
Subproject commit 9139d20c7e7746f6431692fb67a8db4ab8bccf25
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" }
filter "system:windows"
prebuildcommands { "xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include" }
files { "win32select.c", "evthread_win32.c", "buffer_iocp.c", "event_iocp.c", "bufferevent_async.c" }
project "freetype"
kind "StaticLib"
includedirs { "include" }
defines { "FT2_BUILD_LIBRARY" }
files { "src/autofit/autofit.c",
"src/base/ftbase.c",
"src/base/ftbbox.c",
"src/base/ftbdf.c",
"src/base/ftbitmap.c",
"src/base/ftcid.c",
"src/base/ftfstype.c",
"src/base/ftgasp.c",
"src/base/ftglyph.c",
"src/base/ftgxval.c",
"src/base/ftinit.c",
"src/base/ftmm.c",
"src/base/ftotval.c",
"src/base/ftpatent.c",
"src/base/ftpfr.c",
"src/base/ftstroke.c",
"src/base/ftsynth.c",
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
"src/psaux/psaux.c",
"src/pshinter/pshinter.c",
"src/psnames/psmodule.c",
"src/raster/raster.c",
"src/sfnt/sfnt.c",
"src/sdf/sdf.c",
"src/smooth/smooth.c",
"src/truetype/truetype.c",
"src/type1/type1.c",
"src/type42/type42.c",
"src/winfonts/winfnt.c" }
filter "system:windows"
files { "builds/windows/ftsystem.c",
"builds/windows/ftdebug.c" }
filter "not system:windows"
files { "src/base/ftsystem.c",
"src/base/ftdebug.c" }
1 ICON "ygopro.ico"
1 VERSIONINFO
FILEVERSION 1, 0, 35, 3
PRODUCTVERSION 1, 0, 35, 3
FILEOS 0x4
FILETYPE 0x1
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "FileDescription", "YGOPro"
VALUE "InternalName", "YGOPro"
VALUE "LegalCopyright", "Copyright (C) 2022 Fluorohydride"
VALUE "OriginalFilename", "YGOPro.exe"
VALUE "ProductName", "YGOPro"
VALUE "FileVersion", "1.035.3"
VALUE "ProductVersion", "1.035.3"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x804, 1200
END
END
This diff is collapsed.
This diff is collapsed.
project "lua"
kind "StaticLib"
files { "src/*.c", "src/*.h", "src/*.hpp" }
removefiles { "src/lua.c", "src/luac.c" }
filter "action:vs*"
buildoptions { "/TP" }
filter "not action:vs*"
buildoptions { "-x c++" }
filter "system:bsd"
defines { "LUA_USE_POSIX" }
filter "system:macosx"
defines { "LUA_USE_MACOSX" }
filter "system:linux"
defines { "LUA_USE_LINUX" }
project "sqlite3"
kind "StaticLib"
files { "sqlite3.c", "sqlite3.h" }
solution "ygo"
location "build"
language "C++"
objdir "obj"
configurations { "Debug", "Release" }
configuration "windows"
defines { "WIN32", "_WIN32" }
configuration "bsd"
defines { "LUA_USE_POSIX" }
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
configuration "macosx"
defines { "LUA_USE_MACOSX" }
includedirs { "/opt/local/include" }
libdirs { "/opt/local/lib" }
configuration "linux"
defines { "LUA_USE_LINUX" }
configuration "vs*"
flags "EnableSSE2"
buildoptions { "-wd4996", "/utf-8" }
defines { "_CRT_SECURE_NO_WARNINGS" }
configuration "not vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-format-security" }
configuration {"not vs*", "windows"}
buildoptions { "-static-libgcc" }
configuration "Debug"
flags "Symbols"
defines "_DEBUG"
targetdir "bin/debug"
configuration { "Release", "not vs*" }
flags "Symbols"
defines "NDEBUG"
buildoptions "-march=native"
configuration "Release"
flags { "OptimizeSpeed" }
targetdir "bin/release"
include "ocgcore"
include "gframe"
if os.is("windows") then
include "lua"
include "event"
include "freetype"
include "irrlicht"
include "sqlite3"
end
if os.ishost("windows") then
USE_IRRKLANG = true
IRRKLANG_PRO = false
BUILD_LUA = true
BUILD_EVENT = true
BUILD_FREETYPE = true
BUILD_IRRLICHT = true
BUILD_SQLITE = true
else
USE_IRRKLANG = true
IRRKLANG_PRO = false
BUILD_LUA = true
BUILD_EVENT = false --not implemented on linux
BUILD_FREETYPE = false
BUILD_IRRLICHT = not os.ishost("macosx")
BUILD_SQLITE = false
end
workspace "YGOPro"
location "build"
language "C++"
objdir "obj"
configurations { "Release", "Debug" }
filter "system:windows"
defines { "WIN32", "_WIN32", "WINVER=0x0501" }
entrypoint "mainCRTStartup"
systemversion "latest"
startproject "ygopro"
filter "system:bsd"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
filter "system:macosx"
includedirs { "/usr/local/include/freetype2" }
libdirs { "/usr/local/lib" }
buildoptions { "-stdlib=libc++" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
filter "system:linux"
buildoptions { "-U_FORTIFY_SOURCE" }
filter "configurations:Release"
optimize "Speed"
targetdir "bin/release"
filter "configurations:Debug"
symbols "On"
defines "_DEBUG"
targetdir "bin/debug"
filter { "configurations:Release", "action:vs*" }
flags { "LinkTimeOptimization" }
staticruntime "On"
disablewarnings { "4244", "4267", "4838", "4577", "4819", "4018", "4996", "4477", "4091", "4828", "4800" }
filter { "configurations:Release", "not action:vs*" }
symbols "On"
defines "NDEBUG"
buildoptions "-march=native"
filter { "configurations:Debug", "action:vs*" }
defines { "_ITERATOR_DEBUG_LEVEL=0" }
disablewarnings { "4819", "4828" }
filter "action:vs*"
vectorextensions "SSE2"
buildoptions { "/utf-8" }
defines { "_CRT_SECURE_NO_WARNINGS" }
filter "not action:vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar" }
filter {"not action:vs*", "system:windows"}
buildoptions { "-static-libgcc" }
filter {}
include "ocgcore"
include "gframe"
if BUILD_LUA then
include "lua"
end
if BUILD_EVENT then
include "event"
end
if BUILD_FREETYPE then
include "freetype"
end
if BUILD_IRRLICHT then
include "irrlicht"
end
if BUILD_SQLITE then
include "sqlite3"
end
if USE_IRRKLANG and IRRKLANG_PRO then
include "ikpmp3"
end
Subproject commit 95dd7c80a00549265f7f6891705484cb37fc0871
Subproject commit 2685b89a8ae549712ae66f8ff0d4d7d15eaa1cb1
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