Commit a5686e14 authored by Daniel Black's avatar Daniel Black Committed by Sergei Golubchik

MDEV-21303 Use mariadbd as the library plugins link to on non-Linux

Prevent errors like on FreeBSD

[ 56%] Linking CXX shared module ha_test_sql_discovery.so
cd /usr/home/dan/build-mariadb-server-10.5/storage/test_sql_discovery && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/test_sql_discovery.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -O2 -g -DNDEBUG -D_FORTIFY_SOURCE=2 -DDBUG_OFF  -shared  -o ha_test_sql_discovery.so CMakeFiles/test_sql_discovery.dir/test_sql_discovery.cc.o -lpthread ../../libservices/libmysqlservices.a -lmysqld -lpthread
/usr/bin/ld: error: unable to find library -lmysqld

Also tested on OpenIndiana successfully.

Closes #1480
parent 5f3501a6
......@@ -221,7 +221,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_DEPENDENCIES(${target} gen_mysqld_lib)
TARGET_LINK_LIBRARIES(${target} mysqld_import_lib)
ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
TARGET_LINK_LIBRARIES (${target} mysqld)
TARGET_LINK_LIBRARIES (${target} mariadbd)
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN AND NOT WITH_MSAN)
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment