diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-06-29 14:28:20 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-06-30 17:48:19 +0200 |
commit | 460de628a9240085fd15e5b04a6c0f328b855946 (patch) | |
tree | 16945df2f8d8c7ee690e5cc3e6cffe0cb5f66125 | |
parent | db80f047512719311dd6e8ca0dece78094034b40 (diff) | |
download | mariadb-git-460de628a9240085fd15e5b04a6c0f328b855946.tar.gz |
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
-rw-r--r-- | cmake/plugin.cmake | 6 | ||||
-rw-r--r-- | sql/CMakeLists.txt | 9 | ||||
-rw-r--r-- | sql/sql_builtin.cc.in | 6 |
3 files changed, 8 insertions, 13 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index c3c9b55a110..89dfdbb306b 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -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;DEPENDENCIES" ${ARGN} @@ -140,7 +140,9 @@ MACRO(MYSQL_ADD_PLUGIN) ADD_LIBRARY(${target} STATIC ${SOURCES}) DTRACE_INSTRUMENT(${target}) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) - RESTRICT_SYMBOL_EXPORTS(${target}) + 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) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 64a61201322..87e7d0a0238 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -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( @@ -143,7 +144,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 @@ -182,11 +182,10 @@ DTRACE_INSTRUMENT(sql) TARGET_LINK_LIBRARIES(sql mysys mysys_ssl dbug strings vio pcre ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${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}) diff --git a/sql/sql_builtin.cc.in b/sql/sql_builtin.cc.in index 5ac044afd5d..810f98a876c 100644 --- a/sql/sql_builtin.cc.in +++ b/sql/sql_builtin.cc.in @@ -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 }; |