Skip to content

Commit 6634f46

Browse files
committed
fix compilation with ASAN
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.
1 parent 6267be4 commit 6634f46

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libmysql/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,13 @@ IF(NOT DISABLE_SHARED)
466466
OUTPUT_NAME mysqlclient
467467
VERSION "${OS_SHARED_LIB_VERSION}"
468468
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
469-
IF(LINK_FLAG_NO_UNDEFINED OR VERSION_SCRIPT_LINK_FLAGS)
469+
IF(VERSION_SCRIPT_LINK_FLAGS)
470470
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
471+
IF(NOT libmysql_link_flags)
472+
SET(libmysql_link_flags)
473+
ENDIF()
471474
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
472-
"${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}")
475+
"${libmysql_link_flags} ${VERSION_SCRIPT_LINK_FLAGS}")
473476
ENDIF()
474477
# clean direct output needs to be set several targets have the same name
475478
#(mysqlclient in this case)

0 commit comments

Comments
 (0)