Automatically disable testing frameworks if gRPC_BUILD_TESTS=OFF

If gRPC_BUILD_TESTS is set to OFF, automatically set
gRPC_BENCHMARK_PROVIDER and gRPC_GFLAGS_PROVIDER to "none" so that
they don't get built.
pull/20976/head
Kyle Edwards 5 years ago
parent 7d07ce5c87
commit d14fb4e83f
  1. 13
      templates/CMakeLists.txt.template

@ -170,11 +170,16 @@
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")
set(gRPC_GFLAGS_PROVIDER "module" CACHE STRING "Provider of gflags library")
set_property(CACHE gRPC_GFLAGS_PROVIDER PROPERTY STRINGS "module" "package")
if(gRPC_BUILD_TESTS)
set(gRPC_GFLAGS_PROVIDER "module" CACHE STRING "Provider of gflags library")
set_property(CACHE gRPC_GFLAGS_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_BENCHMARK_PROVIDER "module" CACHE STRING "Provider of benchmark library")
set_property(CACHE gRPC_BENCHMARK_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_BENCHMARK_PROVIDER "module" CACHE STRING "Provider of benchmark library")
set_property(CACHE gRPC_BENCHMARK_PROVIDER PROPERTY STRINGS "module" "package")
else()
set(gRPC_GFLAGS_PROVIDER "none")
set(gRPC_BENCHMARK_PROVIDER "none")
endif()
set(gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library")

Loading…
Cancel
Save