diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-08-05 18:38:24 +0200 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-08-05 18:38:24 +0200 |
commit | b94d86215d3f785962cfe2398a2b4ad9b68c028e (patch) | |
tree | 8dc636cff7f3260d888a8f68dca1932af9afc67c /cmake/plugin.cmake | |
parent | f2f65eef739ce44b6ac419790ebe7beb45e86f1d (diff) | |
download | mariadb-git-b94d86215d3f785962cfe2398a2b4ad9b68c028e.tar.gz |
Build cleanups
- Simplify sql-bench installation,
do not try to resolve names : this leads to probem
if builddir is symlink located on different filesystem.
(reported by alik)
- Make WITHOUT_XXX (disabling plugin) work for DEFAULT
plugins. Prior to the patch is behaved just like
MANDATORY.
- LINK_LIBRARIES in MYSQL_ADD_PLUGIN had no effect for
statically linked plugins.
- Fix constant rebuild of initdb target on Windows.
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() |