Commit 6529cba2 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: plugin.cmake

list all supported options in the comment.
remove wsrep-specific hack of EXPORT_SYMBOLS, wsrep-specific hacks
belong to wsrep
parent 4fae7b7a
...@@ -302,9 +302,7 @@ ENDIF() ...@@ -302,9 +302,7 @@ ENDIF()
IF(CMAKE_VERSION VERSION_GREATER "3.9.99") IF(CMAKE_VERSION VERSION_GREATER "3.9.99")
SET(CPACK_SOURCE_GENERATOR "RPM") SET(CPACK_SOURCE_GENERATOR "RPM")
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DRPM=${RPM}")
"-DRPM=${RPM}"
)
MACRO(ADDIF var) MACRO(ADDIF var)
IF(DEFINED ${var}) IF(DEFINED ${var})
......
...@@ -19,19 +19,21 @@ INCLUDE(CMakeParseArguments) ...@@ -19,19 +19,21 @@ INCLUDE(CMakeParseArguments)
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
# [STORAGE_ENGINE] # [STORAGE_ENGINE]
# [CLIENT] # [STATIC_ONLY|MODULE_ONLY]
# [MANDATORY|DEFAULT] # [MANDATORY|DEFAULT]
# [STATIC_ONLY|DYNAMIC_ONLY] # [DISABLED]
# [NOT_EMBEDDED|RECOMPILE_FOR_EMBEDDED]
# [CLIENT]
# [MODULE_OUTPUT_NAME module_name] # [MODULE_OUTPUT_NAME module_name]
# [STATIC_OUTPUT_NAME static_name] # [STATIC_OUTPUT_NAME static_name]
# [RECOMPILE_FOR_EMBEDDED] # [COMPONENT component]
# [NOT_EMBEDDED] # [CONFIG cnf_file_name]
# [LINK_LIBRARIES lib1...libN] # [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN] # [DEPENDENCIES target1...targetN]
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;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT;EXPORT_SYMBOLS" "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"LINK_LIBRARIES;DEPENDENCIES" "LINK_LIBRARIES;DEPENDENCIES"
${ARGN} ${ARGN}
...@@ -140,9 +142,7 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -140,9 +142,7 @@ 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_DEPENDENCIES}) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(NOT ARG_EXPORT_SYMBOLS) RESTRICT_SYMBOL_EXPORTS(${target})
RESTRICT_SYMBOL_EXPORTS(${target})
ENDIF()
IF(WITH_EMBEDDED_SERVER AND (NOT ARG_NOT_EMBEDDED)) IF(WITH_EMBEDDED_SERVER AND (NOT ARG_NOT_EMBEDDED))
# 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,7 +36,14 @@ IF(WITH_WSREP AND NOT EMBEDDED_LIBRARY) ...@@ -36,7 +36,14 @@ IF(WITH_WSREP AND NOT EMBEDDED_LIBRARY)
wsrep_plugin.cc wsrep_plugin.cc
service_wsrep.cc service_wsrep.cc
) )
MYSQL_ADD_PLUGIN(wsrep ${WSREP_SOURCES} MANDATORY NOT_EMBEDDED EXPORT_SYMBOLS LINK_LIBRARIES wsrep-lib wsrep_api_v26) MYSQL_ADD_PLUGIN(wsrep ${WSREP_SOURCES} MANDATORY NOT_EMBEDDED LINK_LIBRARIES wsrep-lib wsrep_api_v26)
IF(VISIBILITY_HIDDEN_FLAG AND TARGET wsrep)
# wsrep_info plugin needs some wsrep symbols from inside mysqld
# we have to remove -fvisibility=hidden from wsrep
GET_TARGET_PROPERTY(f wsrep COMPILE_FLAGS)
STRING(REPLACE "${VISIBILITY_HIDDEN_FLAG}" "" f ${f})
SET_TARGET_PROPERTIES(wsrep PROPERTIES COMPILE_FLAGS "${f}")
ENDIF()
ELSE() ELSE()
ADD_LIBRARY(wsrep STATIC wsrep_dummy.cc) ADD_LIBRARY(wsrep STATIC wsrep_dummy.cc)
ADD_DEPENDENCIES(wsrep GenError) ADD_DEPENDENCIES(wsrep GenError)
......
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