diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-11 13:35:27 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-11 13:35:27 +0100 |
commit | 44c8745ff51506e7554a3a4263d90d32cb4dee6e (patch) | |
tree | 2a0cce6a7a0e67209fe6eaf1e7514e5987434e7c /cmake | |
parent | db7acaa475d748477231e4b21143193de099b179 (diff) | |
download | mariadb-git-44c8745ff51506e7554a3a4263d90d32cb4dee6e.tar.gz |
MDEV-85: Remove shared plugin library if build swtiches from shared to static with
e.g
cmake . -DWITH_XXXX_STORAGE_ENGINE=1
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/plugin.cmake | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 5e59b71fd91..a74802c2314 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -111,8 +111,27 @@ MACRO(MYSQL_ADD_PLUGIN) SET(ARG_DEPENDENCIES) ENDIF() SET(BUILD_PLUGIN 1) + + IF(NOT ARG_MODULE_OUTPUT_NAME) + IF(ARG_STORAGE_ENGINE) + SET(ARG_MODULE_OUTPUT_NAME "ha_${target}") + ELSE() + SET(ARG_MODULE_OUTPUT_NAME "${target}") + ENDIF() + ENDIF() + # Build either static library or module IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY) + + IF(CMAKE_GENERATOR MATCHES "Makefiles") + # If there is a shared library from previous shared build, + # remove it. This is done just for mysql-test-run.pl + # so it does not try to use stale shared lib as plugin + # in test. + FILE(REMOVE + ${CMAKE_CURRENT_BINARY_DIR}/${ARG_MODULE_OUTPUT_NAME}${CMAKE_SHARED_MODULE_SUFFIX}) + ENDIF() + ADD_LIBRARY(${target} STATIC ${SOURCES}) SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER") DTRACE_INSTRUMENT(${target}) @@ -159,14 +178,7 @@ MACRO(MYSQL_ADD_PLUGIN) PARENT_SCOPE) ENDIF() ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS) - IF(NOT ARG_MODULE_OUTPUT_NAME) - IF(ARG_STORAGE_ENGINE) - SET(ARG_MODULE_OUTPUT_NAME "ha_${target}") - ELSE() - SET(ARG_MODULE_OUTPUT_NAME "${target}") - ENDIF() - ENDIF() - + ADD_VERSION_INFO(${target} MODULE SOURCES) ADD_LIBRARY(${target} MODULE ${SOURCES}) DTRACE_INSTRUMENT(${target}) |