Commit 2f3e7777 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

add --disable-shared equivalent

fix mtr (empty argument passed to mysqld)
parent b224e24a
......@@ -67,11 +67,16 @@ INCLUDE(cmake/plugin.cmake)
INCLUDE(cmake/install_macros.cmake)
# Handle options
OPTION(DISABLE_SHARED
"Don't build shared libraries, compile code as position-dependent" OFF)
IF(DISABLE_SHARED)
SET(WITHOUT_DYNAMIC_PLUGINS 1)
ENDIF()
OPTION(ENABLED_PROFILING "Enable profiling" ON)
OPTION(CYBOZU "" OFF)
OPTION(BACKUP_TEST "" OFF)
OPTION(WITHOUT_SERVER OFF)
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER)
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
......
......@@ -153,18 +153,22 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
INSTALL(TARGETS mysqlclient DESTINATION lib)
IF(UNIX)
# Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES OUTPUT_NAME mysqlclient)
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Install links to shared and static libraries
# (append _r to base name)
INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib)
ENDIF()
INSTALL_DEBUG_SYMBOLS(mysqlclient)
INSTALL(TARGETS mysqlclient libmysql DESTINATION lib)
INSTALL_DEBUG_SYMBOLS("mysqlclient;libmysql")
IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
IF(UNIX)
# Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES OUTPUT_NAME mysqlclient)
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1)
INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib)
ENDIF()
INSTALL_DEBUG_SYMBOLS(libmysql)
ENDIF()
......@@ -120,8 +120,10 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
INSTALL(TARGETS mysqlserver DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(mysqlserver)
IF(MSVC)
IF(MSVC AND NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
INSTALL(TARGETS libmysqld DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(libmysqld)
ENDIF()
......@@ -4275,6 +4275,11 @@ sub mysqld_arguments ($$$) {
{
; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config
}
elsif ($arg eq "")
{
# We can get an empty argument when we set environment variables to ""
# (e.g plugin not found). Just skip it.
}
else
{
mtr_add_arg($args, "%s", $arg);
......
......@@ -54,9 +54,6 @@ ENDIF()
IF(UNIX)
# some workarounds
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c)
# Some stuff not ported to windows
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_atomic.c)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_getncpus.c)
ENDIF()
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY})
......
......@@ -178,7 +178,7 @@ ADD_CUSTOM_TARGET(
#Need this only for embedded
SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE)
IF(WIN32 OR HAVE_DLOPEN)
IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
ADD_LIBRARY(udf_example MODULE udf_example.c)
SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "")
# udf_example depends on strings
......
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