Commit c1e1ca20 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub Committed by Sergei Krivonos

In case WITH_WSREP is enabled, build wsrep as plugin

If it is not enabled, build wsrep as static "stub" library from wsrep_dummy.cc
´

Allow static plugins to export symbols (on Unix)
wsrep_info relies on wsrep defined symbols (e.g  LOCK_wsrep_config_state)
exported from mysqld
parent 009f3e06
......@@ -31,7 +31,7 @@ INCLUDE(CMakeParseArguments)
MACRO(MYSQL_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT;EXPORT_SYMBOLS"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"LINK_LIBRARIES;DEPENDS"
${ARGN}
......@@ -140,7 +140,9 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_LIBRARY(${target} STATIC ${SOURCES})
DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
IF(NOT ARG_EXPORT_SYMBOLS)
RESTRICT_SYMBOL_EXPORTS(${target})
ENDIF()
IF(WITH_EMBEDDED_SERVER AND (NOT ARG_NOT_EMBEDDED))
# Embedded library should contain PIC code and be linkable
# to shared libraries (on systems that need PIC)
......
......@@ -36,9 +36,10 @@ IF(WITH_WSREP AND NOT EMBEDDED_LIBRARY)
wsrep_plugin.cc
service_wsrep.cc
)
SET(WSREP_LIB wsrep-lib wsrep_api_v26)
MYSQL_ADD_PLUGIN(wsrep ${WSREP_SOURCES} MANDATORY NOT_EMBEDDED EXPORT_SYMBOLS LINK_LIBRARIES wsrep-lib wsrep_api_v26)
ELSE()
SET(WSREP_SOURCES wsrep_dummy.cc)
ADD_LIBRARY(wsrep STATIC wsrep_dummy.cc)
ADD_DEPENDENCIES(wsrep GenError)
ENDIF()
INCLUDE_DIRECTORIES(
......@@ -142,7 +143,6 @@ SET (SQL_SOURCE
opt_split.cc
rowid_filter.cc rowid_filter.h
opt_trace.cc
${WSREP_SOURCES}
table_cache.cc encryption.cc temporary_tables.cc
proxy_protocol.cc backup.cc xa.cc
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
......@@ -180,11 +180,10 @@ DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql
mysys mysys_ssl dbug strings vio pcre
${LIBWRAP} ${LIBCRYPT} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}
${WSREP_LIB}
${SSL_LIBRARIES}
${LIBSYSTEMD})
FOREACH(se aria partition perfschema sql_sequence)
FOREACH(se aria partition perfschema sql_sequence wsrep)
# These engines are used directly in sql sources.
IF(TARGET ${se})
TARGET_LINK_LIBRARIES(sql ${se})
......
......@@ -32,9 +32,6 @@ extern
builtin_maria_plugin
@mysql_mandatory_plugins@ @mysql_optional_plugins@
builtin_maria_binlog_plugin,
#ifdef WITH_WSREP
builtin_maria_wsrep_plugin,
#endif /* WITH_WSREP */
builtin_maria_mysql_password_plugin;
struct st_maria_plugin *mysql_optional_plugins[]=
......@@ -45,8 +42,5 @@ struct st_maria_plugin *mysql_optional_plugins[]=
struct st_maria_plugin *mysql_mandatory_plugins[]=
{
builtin_maria_binlog_plugin, builtin_maria_mysql_password_plugin,
#ifdef WITH_WSREP
builtin_maria_wsrep_plugin,
#endif /* WITH_WSREP */
@mysql_mandatory_plugins@ 0
};
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