saosir commented on pull request #9072: URL: https://github.com/apache/pulsar/pull/9072#issuecomment-754486867
> The code itself looks good to me. However, introducing `FRIEND_TEST` to code under `lib/` is not a good way. > > Currently, users could define `-DBUILD_TESTS=OFF` in the CMake build phase to skip tests and build libraries only. However, after changes of this PR, the build will fail because it added an extra dependency (GTest) to `lib/` subdirectory. > > I think you can find an alternative way of `FRIEND_TEST` or use a conditional macro to hide the gtest codes under `lib/`. Though you can also just add the GTest dependency in CMakeLists.txt, it's not recommended because the source code without tests should not depend on GTest. How about add Gtest header 'gtest/gtest_prod.h' to dir `pulsar-client-cpp/include` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
