1
- # Copyright (c) 2008, 2020 , Oracle and/or its affiliates.
1
+ # Copyright (c) 2008, 2022 , Oracle and/or its affiliates.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License, version 2.0, as
@@ -375,13 +375,13 @@ endif()
375
375
# Bundle 3rd party dependencies if needed
376
376
# =======================================
377
377
378
- # List client-side plugins, their dependencies and dependencies of the client
379
- # library that are bundled with the server and should be bundled with
380
- # connector. Also list plugins and libraries that can be found with the server
378
+ # List client-side plugins, their dependencies and dependencies of the client
379
+ # library that are bundled with the server and should be bundled with
380
+ # connector. Also list plugins and libraries that can be found with the server
381
381
# but which should be ignored.
382
382
#
383
- # When building in MAINTAINER_MODE cmake will report error if it finds
384
- # a plugin or 3rd party librariy which is not listed here. When that happens
383
+ # When building in MAINTAINER_MODE cmake will report error if it finds
384
+ # a plugin or 3rd party librariy which is not listed here. When that happens
385
385
# the lists should be updated.
386
386
387
387
set (AUTH_PLUGINS
@@ -395,12 +395,12 @@ set(AUTH_PLUGINS
395
395
# Plugin dependencies.
396
396
#
397
397
# Warning: If one library name is a prefix of the other, the longer name
398
- # should be listed first, otherwise the logic detecting missing dependencies
398
+ # should be listed first, otherwise the logic detecting missing dependencies
399
399
# will break... For example: `krb5support` must go before `krb5`
400
400
401
401
set (AUTH_DEPS_fido fido2 )
402
402
403
- # Note: Windows implementation does not depend on MIT Kerberos library, it uses
403
+ # Note: Windows implementation does not depend on MIT Kerberos library, it uses
404
404
# native Win APIs
405
405
406
406
if (NOT WIN32 )
@@ -416,11 +416,10 @@ endif()
416
416
417
417
set (PLUGINS )
418
418
419
- # additional bundled dependencies of the client library
419
+ # additional bundled dependencies of the client library other than the openssl
420
+ # libraries that are handled separately (in DepFindSSL.cmake)
420
421
421
- set (BUNDLED_LIBS
422
- libssl libcrypto ssleay libeay
423
- )
422
+ set (BUNDLED_LIBS )
424
423
425
424
set (IGNORED_PLUGINS qa_auth_client )
426
425
@@ -429,6 +428,7 @@ set(IGNORED_LIBS
429
428
ldap # note: this is needed only by server-side plugin
430
429
libcurl libmecab zlib
431
430
jemalloc
431
+ libssl libcrypto
432
432
)
433
433
434
434
@@ -451,21 +451,29 @@ function(bundle_lib lib)
451
451
COMPONENT JDBCDll
452
452
)
453
453
else ()
454
+ if (APPLE )
455
+ # On Apple, its on the lib dir
454
456
install (FILES ${lib}
455
- DESTINATION "${INSTALL_LIB_DIR} /private "
457
+ DESTINATION "${INSTALL_LIB_DIR} "
456
458
COMPONENT JDBCDll
457
459
)
460
+ else ()
461
+ install (FILES ${lib}
462
+ DESTINATION "${INSTALL_LIB_DIR} /private"
463
+ COMPONENT JDBCDll
464
+ )
465
+ endif ()
458
466
endif ()
459
467
460
468
endfunction (bundle_lib )
461
469
462
470
463
471
# Bundle libraries listed in a list variable ${to_bundle}.
464
- # Libraries that were found and bundled are removed from ${to_bundle} list.
465
- # Other libraries found but not listed in ${to_bundle} are returned
472
+ # Libraries that were found and bundled are removed from ${to_bundle} list.
473
+ # Other libraries found but not listed in ${to_bundle} are returned
466
474
# in ${ignored} variable.
467
- # If additional arguments are given, they are used as glob expressions to find
468
- # the libraries to be bundled, otherwise 3rd parties bundled in with the server
475
+ # If additional arguments are given, they are used as glob expressions to find
476
+ # the libraries to be bundled, otherwise 3rd parties bundled in with the server
469
477
# are searched in ${MYSQL_LIB_DIR} locations.
470
478
471
479
macro (bundle_libs to_bundle ignored )
@@ -478,13 +486,20 @@ macro(bundle_libs to_bundle ignored)
478
486
if (${ARGC} GREATER 2 )
479
487
480
488
file (GLOB _bundled ${ARGN} )
481
-
489
+
482
490
else ()
483
491
484
- file (GLOB _bundled
485
- "${MYSQL_LIB_DIR} /*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
486
- "${MYSQL_LIB_DIR} /private/*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
487
- )
492
+ # On Apple, libs are only on the lib dir, not on private
493
+ if (APPLE )
494
+ file (GLOB _bundled
495
+ "${MYSQL_LIB_DIR} /*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
496
+ )
497
+ else ()
498
+ file (GLOB _bundled
499
+ "${MYSQL_LIB_DIR} /*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
500
+ "${MYSQL_LIB_DIR} /private/*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
501
+ )
502
+ endif ()
488
503
489
504
# On windows, libs are in bin directory
490
505
@@ -532,9 +547,9 @@ macro(bundle_libs to_bundle ignored)
532
547
endmacro (bundle_libs )
533
548
534
549
535
- # Bundle plugins listed in PLUGINS list. Each bundled plugin P is removed from
536
- # the list and its dependedencies listed in DEPS_${P} are also bundled. Client
537
- # side plugins found with the server and not listed in PLUGINS are returned
550
+ # Bundle plugins listed in PLUGINS list. Each bundled plugin P is removed from
551
+ # the list and its dependedencies listed in DEPS_${P} are also bundled. Client
552
+ # side plugins found with the server and not listed in PLUGINS are returned
538
553
# in ${ignored} list.
539
554
540
555
macro (bundle_plugins ignored )
@@ -555,7 +570,7 @@ macro(bundle_plugins ignored)
555
570
556
571
#message("== looking at client-side plugin: ${lib_name}")
557
572
558
- # Match plugin name against names in PLUGINS list and in case of match
573
+ # Match plugin name against names in PLUGINS list and in case of match
559
574
# remove that name from the list
560
575
561
576
unset (plugin )
@@ -651,7 +666,7 @@ if(BUNDLE_DEPENDENCIES)
651
666
endforeach ()
652
667
653
668
# Bundle the plugins and their dependencies.
654
-
669
+
655
670
unset (ingored )
656
671
bundle_plugins (ignored )
657
672
@@ -678,45 +693,29 @@ if(BUNDLE_DEPENDENCIES)
678
693
679
694
message (STATUS "Looking for bundled client lib dependencies" )
680
695
681
- # Bundle additional libraries listed in BUNDLED_LIBS
682
- # For OpenSSL libs, first look in the location of the library that
683
- # is actually being used in the build (for the win case, look also in ../bin/
684
- # because this is where the DLLs can be found, as opposed to the
685
- # corresponding link libraries).
696
+ # Bundle additional libraries listed in BUNDLED_LIBS
686
697
687
- #message("== BUNDLED_LIBS: ${BUNDLED_LIBS}")
688
- #message("== IGNORED_LIBS: ${IGNORED_LIBS}")
689
-
690
- get_filename_component (OPENSSL_DIR ${OPENSSL_LIBRARY} DIRECTORY )
691
-
692
- #message(STATUS "bundle openssl libs")
693
- bundle_libs (BUNDLED_LIBS extra_libs
694
- "${OPENSSL_DIR} /*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
695
- "${OPENSSL_DIR} /../bin/*${CMAKE_SHARED_LIBRARY_SUFFIX} *"
696
- )
697
698
#message(STATUS "bundle other libs")
698
699
unset (extra_libs )
699
700
bundle_libs (BUNDLED_LIBS extra_libs )
700
701
701
- # In MAINTAINER_MODE check whether all 3rd party libs found but not bundled
702
+ # In MAINTAINER_MODE check whether all 3rd party libs found but not bundled
702
703
# are listed in IGNORED_LIBS
703
704
704
705
if (MAINTAINER_MODE )
705
706
706
- # Extend ignore list with libraries that are dependencies of known plugins
707
+ # Extend ignore list with libraries that are dependencies of known plugins
707
708
# and are not listed in BUNDLED_LIBS. Otherwise we would get false errors
708
709
# below.
709
710
710
711
foreach (plugin PLUGINS )
711
712
list (APPEND IGNORED_LIBS ${DEPS_${plugin}} )
712
713
endforeach ()
713
714
714
- # Remove from ${extra_libs} the libraries that we know we should ignore.
715
- # Also the openssl libs that might end up in ${extra_libs} bacause of two
716
- # stage search logic above.
715
+ # Remove from ${extra_libs} the libraries that we know we should ignore.
717
716
718
717
#message("== extra_libs: ${extra_libs}")
719
- foreach (lib ${IGNORED_LIBS} libssl libcrypto ssleay libeay )
718
+ foreach (lib ${IGNORED_LIBS} )
720
719
#message(STATUS "removing: ${lib}")
721
720
list (FILTER extra_libs EXCLUDE REGEX "^${lib} " )
722
721
list (FILTER extra_libs EXCLUDE REGEX "^lib${lib} " )
0 commit comments