diff options
author | Brent Cook <bcook@openbsd.org> | 2018-03-25 19:21:16 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2018-03-25 19:21:16 -0500 |
commit | 55c0cacca0fe675a15389dc175088528a5d2cd00 (patch) | |
tree | d7fe59187a56f99a6f1781f6028280e2747a2797 /CMakeLists.txt | |
parent | 89e5bc52275019dccc608b6a3998fda5c2e1e604 (diff) | |
parent | 4d753badc09cca1a85c4fb7f404bae2d6ed51f5f (diff) | |
download | portable-55c0cacca0fe675a15389dc175088528a5d2cd00.tar.gz portable-55c0cacca0fe675a15389dc175088528a5d2cd00.tar.bz2 portable-55c0cacca0fe675a15389dc175088528a5d2cd00.zip |
Land #406, use BUILD_SHARED_LIBS
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 03c87a4..1c6bd67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -29,10 +29,10 @@ string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) | |||
29 | 29 | ||
30 | option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL}) | 30 | option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL}) |
31 | option(LIBRESSL_APPS "Build apps" ON) | 31 | option(LIBRESSL_APPS "Build apps" ON) |
32 | option(LIBRESSL_TESTS "Build tests" ON) | ||
32 | option(ENABLE_ASM "Enable assembly" ON) | 33 | option(ENABLE_ASM "Enable assembly" ON) |
33 | option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) | 34 | option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) |
34 | option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) | 35 | option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) |
35 | option(ENABLE_VSTEST "Enable test on Visual Studio" OFF) | ||
36 | set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) | 36 | set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) |
37 | 37 | ||
38 | if(NOT LIBRESSL_SKIP_INSTALL) | 38 | if(NOT LIBRESSL_SKIP_INSTALL) |
@@ -262,23 +262,7 @@ if(ENABLE_ASM) | |||
262 | endif() | 262 | endif() |
263 | endif() | 263 | endif() |
264 | 264 | ||
265 | if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|CYGWIN)")) | 265 | set(OPENSSL_LIBS tls ssl crypto) |
266 | set(BUILD_SHARED true) | ||
267 | endif() | ||
268 | |||
269 | # USE_SHARED builds applications (e.g. openssl) using shared LibreSSL. | ||
270 | # By default, applications use LibreSSL static library to avoid dependencies. | ||
271 | # USE_SHARED isn't set by default; use -DUSE_SHARED=ON with CMake to enable. | ||
272 | # Can be helpful for debugging; don't use for public releases. | ||
273 | if(NOT BUILD_SHARED) | ||
274 | set(USE_SHARED off) | ||
275 | endif() | ||
276 | |||
277 | if(USE_SHARED) | ||
278 | set(OPENSSL_LIBS tls-shared ssl-shared crypto-shared) | ||
279 | else() | ||
280 | set(OPENSSL_LIBS tls ssl crypto) | ||
281 | endif() | ||
282 | 266 | ||
283 | if(WIN32) | 267 | if(WIN32) |
284 | set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) | 268 | set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) |
@@ -322,7 +306,8 @@ add_subdirectory(include) | |||
322 | if(NOT MSVC) | 306 | if(NOT MSVC) |
323 | add_subdirectory(man) | 307 | add_subdirectory(man) |
324 | endif() | 308 | endif() |
325 | if(NOT MSVC OR ENABLE_VSTEST) | 309 | # Tests require the openssl executable and are unavailable when building shared libraries |
310 | if(LIBRESSL_APPS AND LIBRESSL_TESTS AND NOT BUILD_SHARED_LIBS) | ||
326 | add_subdirectory(tests) | 311 | add_subdirectory(tests) |
327 | endif() | 312 | endif() |
328 | 313 | ||