Commit 39a15822 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

add --disable-shared equivalent

fix mtr (empty argument passed to mysqld)
parent 23cd3cec
...@@ -67,11 +67,16 @@ INCLUDE(cmake/plugin.cmake) ...@@ -67,11 +67,16 @@ INCLUDE(cmake/plugin.cmake)
INCLUDE(cmake/install_macros.cmake) INCLUDE(cmake/install_macros.cmake)
# Handle options # 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(ENABLED_PROFILING "Enable profiling" ON)
OPTION(CYBOZU "" OFF) OPTION(CYBOZU "" OFF)
OPTION(BACKUP_TEST "" OFF) OPTION(BACKUP_TEST "" OFF)
OPTION(WITHOUT_SERVER 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) 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}) ...@@ -153,18 +153,22 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
# Merge several convenience libraries into one big mysqlclient # Merge several convenience libraries into one big mysqlclient
# and link them together into shared library. # and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS}) MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}) INSTALL(TARGETS mysqlclient DESTINATION lib)
IF(UNIX) IF(UNIX)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib)
ENDIF()
INSTALL_DEBUG_SYMBOLS(mysqlclient)
IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
IF(UNIX)
# Name of shared library is mysqlclient on Unix # Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES OUTPUT_NAME mysqlclient) SET_TARGET_PROPERTIES(libmysql PROPERTIES OUTPUT_NAME mysqlclient)
# clean direct output needs to be set several targets have the same name # clean direct output needs to be set several targets have the same name
#(mysqlclient in this case) #(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1) SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Install links to shared and static libraries SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# (append _r to base name)
INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib) INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib) ENDIF()
INSTALL_DEBUG_SYMBOLS(libmysql)
ENDIF() ENDIF()
INSTALL(TARGETS mysqlclient libmysql DESTINATION lib)
INSTALL_DEBUG_SYMBOLS("mysqlclient;libmysql")
...@@ -120,8 +120,10 @@ ENDFOREACH() ...@@ -120,8 +120,10 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS} MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME}) OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
INSTALL(TARGETS mysqlserver DESTINATION lib) 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}) MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
INSTALL(TARGETS libmysqld DESTINATION lib) INSTALL(TARGETS libmysqld DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(libmysqld)
ENDIF() ENDIF()
...@@ -4275,6 +4275,11 @@ sub mysqld_arguments ($$$) { ...@@ -4275,6 +4275,11 @@ sub mysqld_arguments ($$$) {
{ {
; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config ; # 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 else
{ {
mtr_add_arg($args, "%s", $arg); mtr_add_arg($args, "%s", $arg);
......
...@@ -54,9 +54,6 @@ ENDIF() ...@@ -54,9 +54,6 @@ ENDIF()
IF(UNIX) IF(UNIX)
# some workarounds # some workarounds
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c) 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() ENDIF()
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}) TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY})
......
...@@ -178,7 +178,7 @@ ADD_CUSTOM_TARGET( ...@@ -178,7 +178,7 @@ ADD_CUSTOM_TARGET(
#Need this only for embedded #Need this only for embedded
SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE) 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) ADD_LIBRARY(udf_example MODULE udf_example.c)
SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "")
# udf_example depends on strings # 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