aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-09-11 09:11:08 -0500
committerBrent Cook <bcook@openbsd.org>2015-09-11 09:11:08 -0500
commit2af9873259a4b55d774bf8848cc8847ca401132f (patch)
tree837b4ef54b30a65f1a1336a1437a6e35e351dbaa /CMakeLists.txt
parentef01eb71d1f8df58d1ae56b2e6e7dc631bb68428 (diff)
downloadportable-2af9873259a4b55d774bf8848cc8847ca401132f.tar.gz
portable-2af9873259a4b55d774bf8848cc8847ca401132f.tar.bz2
portable-2af9873259a4b55d774bf8848cc8847ca401132f.zip
add -lrt check for linux
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2aed0c9..ed9cb1f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
1cmake_minimum_required (VERSION 2.8) 1cmake_minimum_required (VERSION 2.8)
2include(CheckFunctionExists) 2include(CheckFunctionExists)
3include(CheckLibraryExists)
3include(CheckIncludeFiles) 4include(CheckIncludeFiles)
4 5
5project (LibreSSL) 6project (LibreSSL)
@@ -159,6 +160,12 @@ set(OPENSSL_LIBS ssl crypto)
159if(CMAKE_HOST_WIN32) 160if(CMAKE_HOST_WIN32)
160 set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) 161 set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32)
161endif() 162endif()
163if(CMAKE_SYSTEM_NAME MATCHES "Linux")
164 check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
165 if (HAVE_CLOCK_GETTIME)
166 set(OPENSSL_LIBS ${OPENSSL_LIBS} rt)
167 endif()
168endif()
162 169
163if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC)) 170if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC))
164 set(BUILD_SHARED true) 171 set(BUILD_SHARED true)