hesphoros commented on code in PR #3548: URL: https://github.com/apache/brpc/pull/3548#discussion_r4049542240
########## docs/cn/getting_started.md: ########## @@ -283,6 +283,42 @@ Monterey中openssl的安装位置可能不再位于`/usr/local/opt/openssl`, * 先运行`brew link openssl --force`看看`/usr/local/opt/openssl`是否出现了 * 没有的话可以自行设置软链:`sudo ln -s /opt/homebrew/Cellar/openssl@3/3.0.3 /usr/local/opt/openssl`。请注意此命令中openssl的目录可能随环境变化而变化,可通过`brew info openssl`查看。 +### 使用 CMake 编译 Debug 版 brpc + +Apple Silicon 可以使用 Homebrew 安装的依赖编译 Debug 版本: + +```shell +cmake -S . -B build-debug -G "Unix Makefiles" \ + -DCMAKE_BUILD_TYPE=Debug \ + -DDEBUG=ON \ + -DCMAKE_OSX_ARCHITECTURES=arm64 \ + -DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \ + -DCMAKE_PREFIX_PATH="$(brew --prefix)" \ + -DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)" +cmake --build build-debug --parallel +``` + +该命令使用单配置的Unix Makefiles生成器,因此`CMAKE_BUILD_TYPE=Debug`会选择 +CMake的Debug构建配置。`DEBUG=ON`启用brpc的调试日志并保留断言。构建产物位于 Review Comment: Addressed separately in #3553. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
