pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Open rickif opened this issue 3 years ago • 0 comments

Fixes https://github.com/apache/pulsar/issues/1964

Motivation

When the pulsar-client-cpp is built with cmake . -DTESTS=OFF, the cmake stil would look for the GTEST_INCLUDE_PATH and GMOCK_INCLUDE_PATH, which leads the problem in #1964.

Modifications

  • remove gtest/gmock from the include_directories of CMakeLists.txt when the BUILD_TESTS=OFF.

Verifying this change

  • [x] Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • [ ] Dependencies (add or upgrade a dependency)
  • [ ] The public API
  • [ ] The schema
  • [ ] The default values of configurations
  • [ ] The binary protocol
  • [ ] The REST endpoints
  • [ ] The admin CLI options
  • [x] Anything that affects deployment

Documentation

  • [ ] doc-required (Your PR needs to update docs and you will update later)

  • [x] doc-not-needed (Please explain why)

  • [ ] doc (Your PR contains doc changes)

  • [ ] doc-complete (Docs have been already added)

Matching PR in forked repository

PR in forked repository: https://github.com/rickif/pulsar

rickif avatar Sep 21 '22 12:09 rickif