Commit bb38fb2a authored by Peter Xin's avatar Peter Xin

Compile server on MacOS

parent 43459c83
......@@ -24,6 +24,20 @@
* sqlite3
* 可参考本项目 [appveyor.yml](https://github.com/mycard/ygopro/blob/server/appveyor.yml) 中的脚本
### MacOS下编译
* 需要以下组件或工具
* clang
* premake5
* libevent
* lua5.3
* sqlite3
* 参考步骤
* 安装libevent sqlite3
* 编译premake5
* wget https://www.lua.org/ftp/lua-5.4.3.tar.gz && tar xf lua-5.4.3.tar.gz && mv lua-5.4.3 lua && cp premake/lua/* lua/
* ./premake5 gmake --cc=clang
* cd build && make config=release
### 运行
* 使用[ygopro-server](https://github.com/mycard/ygopro-server)运行
* 手动运行的参数是
......
......@@ -27,7 +27,7 @@ int main(int argc, char* argv[]) {
#ifndef _WIN32
setlocale(LC_CTYPE, "UTF-8");
#endif
#ifdef __APPLE__
#if defined __APPLE__ && !defined YGOPRO_SERVER_MODE
CFURLRef bundle_url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef bundle_base_url = CFURLCreateCopyDeletingLastPathComponent(NULL, bundle_url);
CFRelease(bundle_url);
......
......@@ -20,7 +20,11 @@ project "ygopro"
files "ygopro.rc"
includedirs { "../event/include", "../sqlite3" }
links { "ws2_32", "lua" }
configuration "linux"
links { "lua5.3-c++" }
configuration "macosx"
links { "lua" }
configuration "not vs*"
buildoptions { "-std=c++14", "-fno-rtti" }
configuration "not windows"
links { "lua5.3-c++", "event_pthreads", "dl", "pthread" }
links { "event_pthreads", "dl", "pthread" }
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" }
......@@ -53,7 +53,11 @@ solution "ygo"
include "ocgcore"
include "gframe"
if os.ishost("windows") then
include "lua"
include "event"
include "sqlite3"
include "lua"
include "event"
include "sqlite3"
end
if os.ishost("macosx") then
include "lua"
LDFLAGS = "-framework Cocoa"
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