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