Skip to content

Commit 718273b

Browse files
committed
cmake: Fix logic for bundling OpenSSL libraries.
Existing logic did not work correctl if system-wide libraries were used - in that case it would bundle all system libraries which is not good.
1 parent 804d267 commit 718273b

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

cdk/cmake/DepFindSSL.cmake

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,35 @@ function(bundle_ssl_libs)
277277
return()
278278
endif()
279279

280-
# Very simplistic approach
280+
# Note: We want to bundle the shared libraries, like libssl.so.1.1,
281+
# not symlinks that point to them
281282

282-
file(GLOB glob1
283-
"${OPENSSL_LIB_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*"
284-
)
283+
if(EXISTS ${OPENSSL_LIBRARY} AND EXISTS ${CRYPTO_LIBRARY})
285284

286-
file(GLOB glob2
287-
"${OPENSSL_LIB_DIR}/../bin/*${CMAKE_SHARED_LIBRARY_SUFFIX}*"
288-
)
285+
# Read symlinks
286+
287+
foreach(lib ${OPENSSL_LIBRARY} ${CRYPTO_LIBRARY})
288+
289+
get_filename_component(path ${lib} REALPATH)
290+
list(APPEND glob1 ${path})
291+
292+
endforeach()
293+
294+
else()
295+
296+
# Very simplistic approach - assuming that OPENSSL_LIB_DIR points
297+
# at OpenSSL installation grab all shared libraries that can be
298+
# found there.
299+
300+
file(GLOB glob1
301+
"${OPENSSL_LIB_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*"
302+
)
303+
304+
file(GLOB glob2
305+
"${OPENSSL_LIB_DIR}/../bin/*${CMAKE_SHARED_LIBRARY_SUFFIX}*"
306+
)
307+
308+
endif()
289309

290310
foreach(lib ${glob1} ${glob2})
291311

jdbc

Submodule jdbc updated 1 file

0 commit comments

Comments
 (0)