File tree Expand file tree Collapse file tree 3 files changed +8
-24
lines changed Expand file tree Collapse file tree 3 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -266,25 +266,12 @@ add_version_info(connector-jdbc
266
266
"Implements MySQL Connector/C++ legacy JDBC API."
267
267
)
268
268
269
+ # Note: The MySQL::client target works (and is needed) both when linking
270
+ # to the MySQL client library dynamically and statically. In the latter case
271
+ # it brings additional linker options that are required (e.g. to resolve
272
+ # dependencies of the client library code).
269
273
270
-
271
- # Note: When connector links statically to the client library, targets using
272
- # the connector must be able to find dependencies of the client library, such
273
- # as openssl libs. The MYSQL_EXTERNAL_SEARCHPATH variable set by DepFindMySQL.
274
- # cmake stores detected locations where client library dependencies that
275
- # are bundled with it can be found. We add it here as interface property
276
- # so that other targets that link with the connector will have library search
277
- # path correctly set in the compile line.
278
- #
279
- # TODO: Modify merge_libraries() logic to autmatically detect transitive link
280
- # directory path properties of merged targets and then set them on the merged
281
- # library target.
282
-
283
- if (MYSQLCLIENT_STATIC_LINKING )
284
- target_link_directories (connector-jdbc INTERFACE
285
- ${MYSQL_EXTERNAL_SEARCHPATH}
286
- )
287
- endif ()
274
+ target_link_libraries (connector-jdbc PUBLIC MySQL::client )
288
275
289
276
290
277
#
Original file line number Diff line number Diff line change @@ -297,7 +297,6 @@ function(main)
297
297
298
298
if (MYSQL_LIB_STATIC )
299
299
target_link_libraries (mysql-client-if INTERFACE MySQL::client-static )
300
- target_link_libraries (mysql-client-if INTERFACE OpenSSL::SSL )
301
300
else ()
302
301
target_link_libraries (mysql-client-if INTERFACE MySQL::client-shared )
303
302
endif ()
@@ -379,7 +378,7 @@ function(main)
379
378
380
379
#
381
380
# If external dependencies were found, add them to the static target
382
- # as any code that liks to static library should also link with the
381
+ # as any code that links to static library should also link with the
383
382
# external dependencies.
384
383
#
385
384
@@ -531,7 +530,8 @@ function(use_mysql_config)
531
530
# option.
532
531
533
532
if (NOT lib MATCHES
534
- "(mysqlclient|libmysql|^stdc|^gcc|^CrunG3|^c$|^statomic|^ssl|^crypto)"
533
+ "(mysqlclient|libmysql|^stdc|^gcc|^CrunG3|^c$|^statomic)"
534
+ #|^ssl|^crypto)"
535
535
)
536
536
537
537
list (APPEND MYSQL_EXTERNAL_DEPENDENCIES ${lib} )
Original file line number Diff line number Diff line change @@ -79,9 +79,6 @@ IF(MSBUILD)
79
79
ADD_DEFINITIONS ("-D_CRT_SECURE_NO_WARNINGS" )
80
80
ENDIF ()
81
81
82
- if (NOT MYSQLCLIENT_STATIC_LINKING )
83
- list (APPEND MY_TARGET_LINK_LIBRARIES MySQL::client )
84
- endif ()
85
82
86
83
IF (CMAKE_COMPILER_IS_GNUCC AND MYSQLCPPCONN_GCOV_ENABLE )
87
84
SET (MY_GCOV_LINK_LIBRARIES gcov )
You can’t perform that action at this time.
0 commit comments