Skip to content

Commit

Permalink
fix compilation with ASAN
Browse files Browse the repository at this point in the history
if the property is not found, set it to the empty string,
otherwise it'll show as libmysql_link_flags-NOTFOUND on the linker
command line, and the linker won't like it.

Also, don't specify LINK_FLAG_NO_UNDEFINED twice, MERGE_LIBRARIES
already put it into LINK_FLAGS.
  • Loading branch information
vuvova committed Jan 16, 2018
1 parent 6267be4 commit 6634f46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libmysql/CMakeLists.txt
Expand Up @@ -466,10 +466,13 @@ IF(NOT DISABLE_SHARED)
OUTPUT_NAME mysqlclient
VERSION "${OS_SHARED_LIB_VERSION}"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
IF(LINK_FLAG_NO_UNDEFINED OR VERSION_SCRIPT_LINK_FLAGS)
IF(VERSION_SCRIPT_LINK_FLAGS)
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
IF(NOT libmysql_link_flags)
SET(libmysql_link_flags)
ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
"${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}")
"${libmysql_link_flags} ${VERSION_SCRIPT_LINK_FLAGS}")
ENDIF()
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
Expand Down

0 comments on commit 6634f46

Please sign in to comment.