Copilot commented on code in PR #3548: URL: https://github.com/apache/brpc/pull/3548#discussion_r4028751191
########## docs/en/getting_started.md: ########## @@ -291,6 +291,44 @@ openssl installed in Monterey may not be found at `/usr/local/opt/openssl`, inst * Run `brew link openssl --force` first and check if `/usr/local/opt/openssl` appears. * If above command does not work, consider making a soft link using `sudo ln -s /opt/homebrew/Cellar/openssl@3/3.0.3 /usr/local/opt/openssl`. Note that the installed openssl in above command may be put in different places in different environments, which could be revealed by running `brew info openssl`. +### Compile a Debug build with cmake + +Apple Silicon can build the Debug configuration against dependencies installed by Homebrew: + +```shell +cmake -S . -B build-debug \ + -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 +``` + +`CMAKE_BUILD_TYPE=Debug` selects cmake's Debug configuration, while `DEBUG=ON` Review Comment: `CMAKE_BUILD_TYPE=Debug` is ignored by multi-config generators (notably Xcode). Since the command does not specify a generator, readers using Xcode may end up building a different configuration than intended. Consider either documenting that the instructions assume a single-config generator (e.g., Unix Makefiles/Ninja), or adding a note/example to build with `cmake --build build-debug --config Debug` when using a multi-config generator. ########## docs/cn/getting_started.md: ########## @@ -283,6 +283,41 @@ 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 Review Comment: 中文文档里同样混用了 `cmake`/`CMake` 的写法。建议与英文保持一致,把标题和正文中的产品名统一为 `CMake`(例如“使用 CMake 编译 Debug 版 brpc”、“启用 CMake 的 Debug 构建配置”),提升一致性与可读性。 ########## docs/en/getting_started.md: ########## @@ -291,6 +291,44 @@ openssl installed in Monterey may not be found at `/usr/local/opt/openssl`, inst * Run `brew link openssl --force` first and check if `/usr/local/opt/openssl` appears. * If above command does not work, consider making a soft link using `sudo ln -s /opt/homebrew/Cellar/openssl@3/3.0.3 /usr/local/opt/openssl`. Note that the installed openssl in above command may be put in different places in different environments, which could be revealed by running `brew info openssl`. +### Compile a Debug build with cmake + +Apple Silicon can build the Debug configuration against dependencies installed by Homebrew: + +```shell +cmake -S . -B build-debug \ + -DCMAKE_BUILD_TYPE=Debug \ Review Comment: `CMAKE_BUILD_TYPE=Debug` is ignored by multi-config generators (notably Xcode). Since the command does not specify a generator, readers using Xcode may end up building a different configuration than intended. Consider either documenting that the instructions assume a single-config generator (e.g., Unix Makefiles/Ninja), or adding a note/example to build with `cmake --build build-debug --config Debug` when using a multi-config generator. ########## docs/en/getting_started.md: ########## @@ -291,6 +291,44 @@ openssl installed in Monterey may not be found at `/usr/local/opt/openssl`, inst * Run `brew link openssl --force` first and check if `/usr/local/opt/openssl` appears. * If above command does not work, consider making a soft link using `sudo ln -s /opt/homebrew/Cellar/openssl@3/3.0.3 /usr/local/opt/openssl`. Note that the installed openssl in above command may be put in different places in different environments, which could be revealed by running `brew info openssl`. +### Compile a Debug build with cmake Review Comment: The documentation mixes `cmake` and `CMake` as the product name (and in possessive form). For clarity and consistency in docs, consider capitalizing as `CMake` in headings and prose (e.g., \"Compile a Debug build with CMake\" and \"CMake's Debug configuration\"). ########## docs/en/getting_started.md: ########## @@ -291,6 +291,44 @@ openssl installed in Monterey may not be found at `/usr/local/opt/openssl`, inst * Run `brew link openssl --force` first and check if `/usr/local/opt/openssl` appears. * If above command does not work, consider making a soft link using `sudo ln -s /opt/homebrew/Cellar/openssl@3/3.0.3 /usr/local/opt/openssl`. Note that the installed openssl in above command may be put in different places in different environments, which could be revealed by running `brew info openssl`. +### Compile a Debug build with cmake + +Apple Silicon can build the Debug configuration against dependencies installed by Homebrew: + +```shell +cmake -S . -B build-debug \ + -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 +``` + +`CMAKE_BUILD_TYPE=Debug` selects cmake's Debug configuration, while `DEBUG=ON` Review Comment: The documentation mixes `cmake` and `CMake` as the product name (and in possessive form). For clarity and consistency in docs, consider capitalizing as `CMake` in headings and prose (e.g., \"Compile a Debug build with CMake\" and \"CMake's Debug configuration\"). ########## docs/cn/getting_started.md: ########## @@ -283,6 +283,41 @@ 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 \ + -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 +``` + +`CMAKE_BUILD_TYPE=Debug`启用cmake的Debug构建配置,`DEBUG=ON`启用brpc的 Review Comment: 中文文档里同样混用了 `cmake`/`CMake` 的写法。建议与英文保持一致,把标题和正文中的产品名统一为 `CMake`(例如“使用 CMake 编译 Debug 版 brpc”、“启用 CMake 的 Debug 构建配置”),提升一致性与可读性。 -- 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]
