Support MacOS (#365)
Some checks failed
Check Whitespace and New Line / check (push) Has been cancelled
Deploy Sphinx documentation to Pages / pages (push) Has been cancelled

通过这个PR,FreeKill可以在MacOS上编译运行。

在repo根目录运行 `./build/FreeKill`,游戏可玩,有背景音,但是出牌语音似乎没了。是我的运行方式有问题么?
This commit is contained in:
Zheng Qu 2024-10-14 12:45:07 +02:00 committed by GitHub
parent 951a9a0497
commit 354e0ba42e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 45 additions and 3 deletions

View File

@ -98,7 +98,25 @@ Linux服务器
MacOS
-----
大致与Windows类似但尚且缺少确切的方案。
安装依赖:
.. code:: sh
$ brew install libgit2 swig qt lua
更新submodule
.. code:: sh
$ git submodule update --init --recursive
然后使用命令行编译:
.. code:: sh
$ mkdir build && cd build
$ cmake ..
$ make -j8
--------------

View File

@ -1,4 +1,4 @@
<!DOCTYPE TS><TS>
<!DOCTYPE TS><TS language="en_US">
<context>
<name>Init</name>

View File

@ -1,4 +1,4 @@
<!DOCTYPE TS><TS>
<!DOCTYPE TS><TS language="zh_CN">
<context>
<name>ClientSocket</name>
<message>

View File

@ -63,6 +63,30 @@ elseif (ANDROID)
QT_ANDROID_EXTRA_LIBS "${LUA_LIB};${SQLITE3_LIB};${CRYPTO_LIB};${SSL_LIB};${SSH_LIB};${GIT_LIB}"
)
list(REMOVE_ITEM QT_LIB Qt6::QuickControls2)
elseif (APPLE)
set(LUA_LIB ${LUA_LIBRARIES})
set(SQLITE3_LIB sqlite3)
set(CRYPTO_LIB OpenSSL::Crypto)
set(READLINE_LIB readline)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/opt/homebrew/Cellar/libgit2")
find_package(PkgConfig)
if (PkgConfig_FOUND)
pkg_check_modules(LIBGIT2 libgit2)
if (LIBGIT2_FOUND)
message(STATUS "Found libgit2: ${LIBGIT2_LIBRARIES}")
else ()
message(WARNING "libgit2 not found, try to find libgit2 by CMake")
find_package(LibGit2)
endif ()
else ()
message(WARNING "PkgConfig not found, try to find libgit2 by CMake")
find_package(LibGit2)
endif ()
set(GIT_LIB ${LIBGIT2_LIBRARIES})
target_link_directories(FreeKill PRIVATE
${LIBGIT2_LIBRARY_DIRS}
)
else ()
set(LUA_LIB lua5.4)
set(SQLITE3_LIB sqlite3)