From 79ec0ff5427728d6da7329ed41e3af880a527a35 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 19 Apr 2017 03:14:26 -0700 Subject: Increase portability of CMakeLists.txt - Update CMakeLists.txt (original template and generated code) to prevent forcefully linking `dl` on all UNIX platforms, and rely on `${CMAKE_DL_LIBS}` portable variable instead. - Do not try linking against `librt` on macOS. - Add a `config_freebsd` directory containing the header file generated by the `configure` script for the `ares` library. --- templates/CMakeLists.txt.template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index c647ea5707..88e518f132 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -314,8 +314,10 @@ set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS} -std=c++11") endif() - if(UNIX) - set(_gRPC_ALLTARGETS_LIBRARIES dl rt m pthread) + if(_gRPC_PLATFORM_MAC) + set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS} m pthread) + elseif(UNIX) + set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS} rt m pthread) endif() if(WIN32 AND MSVC) -- cgit v1.2.3