diff options
author | Mehrdad Afshari <mmx@google.com> | 2017-04-19 03:14:26 -0700 |
---|---|---|
committer | Mehrdad Afshari <mehrdada@users.noreply.github.com> | 2017-04-20 14:33:13 -0700 |
commit | 79ec0ff5427728d6da7329ed41e3af880a527a35 (patch) | |
tree | 57edca86ebf1cc694b7b50d34033392f64dc81e6 /templates | |
parent | f935b3cae8b8de31ec20e6652c9273b56ba53b9f (diff) |
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.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/CMakeLists.txt.template | 6 |
1 files changed, 4 insertions, 2 deletions
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}</%text> -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}</%text> m pthread) + elseif(UNIX) + set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> rt m pthread) endif() if(WIN32 AND MSVC) |