aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--templates/CMakeLists.txt.template3
2 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebceb86594..eac63a9fe3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,7 +132,8 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module")
if(NOT CARES_ROOT_DIR)
set(CARES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cares/cares)
endif()
- set(CARES_STATIC ON)
+ set(CARES_SHARED OFF CACHE BOOL "disable shared library")
+ set(CARES_STATIC ON CACHE BOOL "link cares statically")
set(CARES_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cares/cares")
add_subdirectory(third_party/cares/cares)
if(TARGET c-ares)
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index f2ce9b5a90..567bd3b7f8 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -177,7 +177,8 @@
if(NOT CARES_ROOT_DIR)
set(CARES_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/cares/cares)
endif()
- set(CARES_STATIC ON)
+ set(CARES_SHARED OFF CACHE BOOL "disable shared library")
+ set(CARES_STATIC ON CACHE BOOL "link cares statically")
set(CARES_INCLUDE_DIR "<%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/cares/cares")
add_subdirectory(third_party/cares/cares)
if(TARGET c-ares)