diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index ff95ed86a25..99148b52adf 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Turn off gTest in gBenchmark") - if("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "module") + set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Turn off gTest in gBenchmark") if(NOT BENCHMARK_ROOT_DIR) set(BENCHMARK_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/benchmark) endif() diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 59410f7bdf3..4057da40c16 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -53,7 +53,7 @@ deps.append("${_gRPC_BENCHMARK_LIBRARIES}") else: deps.append(d) - if target_dict.build == 'test' or target_dict.build == 'private' and target_dict.language == 'c++': + if (target_dict.build == 'test' or target_dict.build == 'private') and target_dict.language == 'c++': deps.append("${_gRPC_GFLAGS_LIBRARIES}") return deps