Skip to content

Commit f8c4c26

Browse files
committed
FindMySQL.cm
- Enable to add libraries from a command line flag -DEXTRA_MYSQL_DEP=... - If EXTRA_MYSQL_DEP is set, remove "libssl" and "libcrypto" from the linkage against the MySQL Server client library and let the one building control that linkage
1 parent 811b044 commit f8c4c26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

FindMySQL.cm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ ELSE (WIN32)
111111
_MYSQL_CONFIG(MYSQL_LIBRARIES "(^| )-l" "--libs_r")
112112
_MYSQL_CONFIG(MYSQL_LIB_DIR "(^| )-L" "--libs_r")
113113

114+
# 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)
120+
LIST(REMOVE_ITEM MYSQL_LIBRARIES "ssl" "crypto")
121+
LIST(APPEND MYSQL_LIBRARIES ${EXTRA_MYSQL_DEP})
122+
ENDIF (EXTRA_MYSQL_DEP)
123+
114124
EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--version"
115125
OUTPUT_VARIABLE __MYSQL_VERSION
116126
)

0 commit comments

Comments
 (0)