Skip to content

Commit 8550e10

Browse files
committed
Have open source use the static openssl libraries
For the packaging step, it is expecting the libraries to be the static versions, so use those instead. Corrects the one case that was using only the one library, when both are now needed as a result. Tests build and run on all desktop platforms with this change. PiperOrigin-RevId: 291441343
1 parent 4f52d7d commit 8550e10

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ endif()
120120

121121
# Some of the external libraries are not used for mobile.
122122
if (NOT ANDROID AND NOT IOS)
123+
# Use the static versions of the OpenSSL libraries.
124+
set(OPENSSL_USE_STATIC_LIBS TRUE)
125+
if (MSVC)
126+
# Get the correct version of the OpenSSL libraries based on building for MT.
127+
if ("${CMAKE_CXX_FLAGS_DEBUG}" MATCHES "/MT" OR
128+
"${CMAKE_CXX_FLAGS_RELEASE}" MATCHES "/MT")
129+
set(OPENSSL_MSVC_STATIC_RT TRUE)
130+
else()
131+
set(OPENSSL_MSVC_STATIC_RT FALSE)
132+
endif()
133+
endif()
134+
123135
# Build curl as a static library
124136
set(CURL_STATICLIB ON CACHE BOOL "")
125137
if (WIN32)
@@ -185,7 +197,7 @@ if (NOT ANDROID AND NOT IOS)
185197
)
186198
target_link_libraries(libuWS
187199
PRIVATE
188-
${OPENSSL_SSL_LIBRARY}
200+
${OPENSSL_LIBRARIES}
189201
uv_a
190202
zlibstatic
191203
)

app/rest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ target_link_libraries(firebase_rest_lib
7676
flatbuffers
7777
libcurl
7878
zlibstatic
79+
${CMAKE_DL_LIBS}
7980
)
8081
# Automatically include headers that might not be declared.
8182
if(MSVC)

0 commit comments

Comments
 (0)