Skip to content

Commit 717bbbd

Browse files
authored
Enable explicit static SSL linking (#55)
1 parent 5ea7d4e commit 717bbbd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ endif()
3030
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
3131
# Config of some libraries (e.g. replxx) depends on the build type.
3232
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE)
33+
# Enable explicit static linking of SSL because of generic Linux binary.
34+
set(MGCONSOLE_STATIC_SSL OFF CACHE STRING "Statically link SSL")
3335

3436
# Set default instalation directory to '/usr'
3537
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -39,7 +41,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
3941
endif()
4042

4143
add_subdirectory(src)
42-
4344
if(BUILD_TESTING)
4445
add_subdirectory(tests)
4546
endif()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To build and install mgconsole from source you will need:
1111
- CMake version >= 3.4
1212
- OpenSSL version >= 1.0.2
1313
- C compiler supporting C11
14-
- C++ compiler supporting C++17
14+
- C++ compiler supporting C++20
1515

1616
To install compile dependencies on Debian / Ubuntu:
1717

src/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ find_package(Threads REQUIRED)
3030
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
3131
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
3232

33-
if(NOT MGCONSOLE_ON_LINUX)
33+
if(NOT MGCONSOLE_ON_LINUX OR MGCONSOLE_STATIC_SSL)
3434
set(OPENSSL_USE_STATIC_LIBS TRUE)
3535
endif()
36-
3736
find_package(OpenSSL REQUIRED)
38-
3937
if(MGCONSOLE_ON_OSX)
4038
set(MACOSX_OPENSSL_ROOTDIR_FLAG "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}")
4139
endif()

0 commit comments

Comments
 (0)