Skip to content

Commit 5df59f7

Browse files
committed
Only remove OpenSSL linkage if -DREMOVE_OPENSSL_DEP=1 is given to the 'cmake' call
1 parent f8c4c26 commit 5df59f7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

FindMySQL.cm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,18 @@ ELSE (WIN32)
112112
_MYSQL_CONFIG(MYSQL_LIB_DIR "(^| )-L" "--libs_r")
113113

114114
# In MySQL Server 5.6.10 "mysql_config" outputs -lssl
115-
# -lcrypto dependencies. We want to be able to statically
116-
# link with OpenSSL, so we honor a -DEXTRA_MYSQL_DEP=...
117-
# argument on the command line, and assume that you want
118-
# to add SSL libraries to link against yourself
119-
IF (EXTRA_MYSQL_DEP)
115+
# -lcrypto dependencies even if (as it is with the
116+
# Oracle built binaries) OpenSSL is linked statically
117+
# to the client library and no reference is needed.
118+
# We remove the OpenSSL libraries if -DREMOVE_OPENSSL_DEP
119+
# is given
120+
IF (REMOVE_OPENSSL_DEP)
120121
LIST(REMOVE_ITEM MYSQL_LIBRARIES "ssl" "crypto")
122+
ENDIF (REMOVE_OPENSSL_DEP)
123+
124+
# Optionally add more libraries from the command line
125+
# using -DEXTRA_MYSQL_DEP=...
126+
IF (EXTRA_MYSQL_DEP)
121127
LIST(APPEND MYSQL_LIBRARIES ${EXTRA_MYSQL_DEP})
122128
ENDIF (EXTRA_MYSQL_DEP)
123129

0 commit comments

Comments
 (0)