Skip to content

Commit

Permalink
cmake: enable static linking of OpenSSL if BUILD_STATIC is set
Browse files Browse the repository at this point in the history
Currently, the BUILD_STATIC and BUILD_STATIC_WITH_BUNDLED_LIBS cmake
options don't enable static linking of the OpenSSL library so we have
to set OPENSSL_USE_STATIC_LIBS explicitly. Let's enable static linking
of OpenSSL by default because we enable it anyway in all our official
builds.

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build
  • Loading branch information
locker committed Nov 9, 2023
1 parent a367265 commit edadffd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ endif()
# OpenSSL
#

option(OPENSSL_USE_STATIC_LIBS "Link OpenSSL statically"
${BUILD_STATIC})
set(ENABLE_BUNDLED_OPENSSL_DEFAULT OFF)
if(BUILD_STATIC_WITH_BUNDLED_LIBS AND OPENSSL_USE_STATIC_LIBS)
set(ENABLE_BUNDLED_OPENSSL_DEFAULT ON)
Expand Down Expand Up @@ -851,6 +853,7 @@ set(options PACKAGE VERSION BUILD C_COMPILER CXX_COMPILER C_FLAGS CXX_FLAGS
ENABLE_DOC
ENABLE_DIST
ENABLE_BUNDLED_ZLIB
OPENSSL_USE_STATIC_LIBS
ENABLE_BUNDLED_OPENSSL
ENABLE_BUNDLED_LIBCURL
BUNDLED_LIBCURL_USE_ARES
Expand Down
1 change: 0 additions & 1 deletion static-build/cmake/AddTarantoolProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ExternalProject_Add(tarantool
# https://cmake.org/cmake/help/v3.4/module/GNUInstallDirs.html#special-cases
-DCMAKE_INSTALL_LOCALSTATEDIR=<INSTALL_DIR>/var
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DOPENSSL_USE_STATIC_LIBS=TRUE
-DBUILD_STATIC_WITH_BUNDLED_LIBS=TRUE
-DENABLE_DIST=TRUE
-DENABLE_HARDENING=${ENABLE_HARDENING}
Expand Down

0 comments on commit edadffd

Please sign in to comment.