Skip to content

Commit 595ab61

Browse files
author
Bogdan Degtyariov
committed
Bug#37094209 - JDBC: Pluggable authentication not working on MacOS
Change-Id: I4193a31a5263d3888227a6a876a8c9019dda7c55
1 parent 0388a3c commit 595ab61

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

jdbc/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,18 @@ function(bundle_lib lib)
558558
DESTINATION "${INSTALL_LIB_DIR}"
559559
COMPONENT JDBCDll
560560
)
561+
# Symlinks need to be created to allow authenticating
562+
# plugins to load dependencies in MacOS
563+
#
564+
# NOTE: in Linux the dependencies are adressed in
565+
# a different way
566+
install(CODE "
567+
execute_process(
568+
COMMAND ${CMAKE_COMMAND} -E create_symlink ../${lib_name} ${lib_name}
569+
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/plugin\"
570+
)
571+
")
572+
561573
else()
562574
install(FILES ${lib}
563575
DESTINATION "${INSTALL_LIB_DIR}/private"
@@ -648,6 +660,26 @@ macro(bundle_libs to_bundle ignored)
648660

649661
endforeach()
650662

663+
if(APPLE)
664+
# Create symlinks for OpenSSL dependencies in MacOS.
665+
# The actual OpenSSL libraries should already be
666+
# installed with XDevAPI connector.
667+
# Other dependencies such as fido2 already have symlinks
668+
# created at this stage.
669+
install(CODE "
670+
foreach(openssl_lib ssl crypto)
671+
file(GLOB found_libs \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/lib\${openssl_lib}.*dylib\")
672+
foreach(lib_file \${found_libs})
673+
get_filename_component(openssl_lib_name \${lib_file} NAME)
674+
execute_process(
675+
COMMAND ${CMAKE_COMMAND} -E create_symlink ../\${openssl_lib_name} \${openssl_lib_name}
676+
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/plugin\"
677+
)
678+
endforeach(lib_file)
679+
endforeach(openssl_lib)
680+
")
681+
endif()
682+
651683
endmacro(bundle_libs)
652684

653685

0 commit comments

Comments
 (0)