diff options
Diffstat (limited to 'cmake/plugin.cmake')
-rw-r--r-- | cmake/plugin.cmake | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 94edfb8741a..138901dfa8a 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -57,11 +57,17 @@ MACRO(MYSQL_ADD_PLUGIN) SET(WITHOUT_NDBCLUSTER 1) ENDIF() + IF(ARG_DEFAULT) + IF(NOT DEFINED WITH_${plugin} AND + NOT DEFINED WITH_${plugin}_STORAGE_ENGINE) + SET(WITH_${plugin} 1) + ENDIF() + ENDIF() + IF(WITH_${plugin}_STORAGE_ENGINE OR WITH_{$plugin} OR WITH_ALL OR WITH_MAX - OR ARG_DEFAULT AND NOT WITHOUT_${plugin}_STORAGE_ENGINE AND NOT WITHOUT_${plugin} AND NOT ARG_MODULE_ONLY) @@ -88,6 +94,7 @@ MACRO(MYSQL_ADD_PLUGIN) IF(NOT ARG_DEPENDENCIES) SET(ARG_DEPENDENCIES) ENDIF() + SET(BUILD_PLUGIN 1) # Build either static library or module IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY) ADD_LIBRARY(${target} STATIC ${SOURCES}) @@ -148,9 +155,6 @@ MACRO(MYSQL_ADD_PLUGIN) DTRACE_INSTRUMENT(${target}) SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") - IF(ARG_LINK_LIBRARIES) - TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES}) - ENDIF() TARGET_LINK_LIBRARIES (${target} mysqlservices) # Plugin uses symbols defined in mysqld executable. @@ -165,17 +169,30 @@ MACRO(MYSQL_ADD_PLUGIN) ENDIF() ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) - IF(NOT ARG_MODULE_ONLY) + IF(NOT ARG_MODULE_ONLY) # set cached variable, e.g with checkbox in GUI SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server" FORCE) - ENDIF() + ENDIF() SET_TARGET_PROPERTIES(${target} PROPERTIES OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") # Install dynamic library MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server) INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug) + ELSE() + IF(WITHOUT_${plugin}) + # Update cache variable + STRING(REPLACE "WITH_" "WITHOUT_" without_var ${with_var}) + SET(${without_var} ON CACHE BOOL "Don't build ${plugin}" + FORCE) + ENDIF() + SET(BUILD_PLUGIN 0) ENDIF() + + IF(BUILD_PLUGIN AND ARG_LINK_LIBRARIES) + TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES}) + ENDIF() + ENDMACRO() |