diff --git a/docs/inner/01-compile.rst b/docs/inner/01-compile.rst index b50bda55..36df95b8 100644 --- a/docs/inner/01-compile.rst +++ b/docs/inner/01-compile.rst @@ -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 -------------- diff --git a/lang/en_US.ts b/lang/en_US.ts index dc62d504..fcb29b43 100644 --- a/lang/en_US.ts +++ b/lang/en_US.ts @@ -1,4 +1,4 @@ - + Init diff --git a/lang/zh_CN.ts b/lang/zh_CN.ts index 9133b542..c9dd612b 100644 --- a/lang/zh_CN.ts +++ b/lang/zh_CN.ts @@ -1,4 +1,4 @@ - + ClientSocket diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 566bcec7..5ecec622 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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)