summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/plugin.cmake22
-rw-r--r--libmysqld/CMakeLists.txt2
3 files changed, 19 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 542f599d374..82b6690e3fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -404,7 +404,7 @@ IF(WITH_UNIT_TESTS)
ENDIF()
ENDIF()
-SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
+UNSET (MYSQLD_STATIC_PLUGIN_LIBS CACHE)
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 076e656cf78..c3c9b55a110 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -25,12 +25,13 @@ INCLUDE(CMakeParseArguments)
# [MODULE_OUTPUT_NAME module_name]
# [STATIC_OUTPUT_NAME static_name]
# [RECOMPILE_FOR_EMBEDDED]
+# [NOT_EMBEDDED]
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
MACRO(MYSQL_ADD_PLUGIN)
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;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"LINK_LIBRARIES;DEPENDENCIES"
${ARGN}
@@ -140,7 +141,7 @@ MACRO(MYSQL_ADD_PLUGIN)
DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
RESTRICT_SYMBOL_EXPORTS(${target})
- IF(WITH_EMBEDDED_SERVER)
+ 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)
IF(ARG_RECOMPILE_FOR_EMBEDDED OR NOT _SKIP_PIC)
@@ -165,19 +166,30 @@ MACRO(MYSQL_ADD_PLUGIN)
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
ENDIF()
+ SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server" FORCE)
+
# Update mysqld dependencies
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
- SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server" FORCE)
+ IF(WITH_EMBEDDED_SERVER AND (NOT ARG_NOT_EMBEDDED))
+ SET (EMBEDDED_PLUGIN_LIBS ${EMBEDDED_PLUGIN_LIBS}
+ ${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
+ ENDIF()
+
+ IF(ARG_NOT_EMBEDDED)
+ SET(builtin_entry "#ifndef EMBEDDED_LIBRARY\n builtin_maria_${target}_plugin,\n#endif")
+ ELSE()
+ SET(builtin_entry " builtin_maria_${target}_plugin,")
+ ENDIF()
IF(ARG_MANDATORY)
SET (mysql_mandatory_plugins
- "${mysql_mandatory_plugins} builtin_maria_${target}_plugin,")
+ "${mysql_mandatory_plugins}${builtin_entry}\n")
SET (mysql_mandatory_plugins ${mysql_mandatory_plugins} PARENT_SCOPE)
ELSE()
SET (mysql_optional_plugins
- "${mysql_optional_plugins} builtin_maria_${target}_plugin,")
+ "${mysql_optional_plugins}${builtin_entry}\n")
SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF()
ELSEIF(PLUGIN_${plugin} MATCHES "(DYNAMIC|AUTO|YES)"
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index d57ea3939d0..eae85df2a54 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -153,7 +153,7 @@ SET(LIBS
dbug strings mysys mysys_ssl pcre vio
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
- ${MYSQLD_STATIC_PLUGIN_LIBS}
+ ${EMBEDDED_PLUGIN_LIBS}
sql_embedded
)