summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-18 12:26:58 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-18 12:26:58 +0300
commitcd65845a0eee830b8c783d2ebecae9d305e255c3 (patch)
tree72ef5515315361568e9734e6253be80213d4a5bf /cmake
parent2d259187a2f585ef6bc5bd66997975ebc4264c66 (diff)
parentf73eea4984b632c1955211b9ea5b54be9dd56975 (diff)
downloadmariadb-git-cd65845a0eee830b8c783d2ebecae9d305e255c3.tar.gz
Merge 10.2 into 10.3
MDEV-18734 FIXME: vcol.partition triggers ASAN heap-use-after-free
Diffstat (limited to 'cmake')
-rw-r--r--cmake/plugin.cmake31
1 files changed, 18 insertions, 13 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index ff911008939..e7e9d2a3642 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -26,13 +26,13 @@ INCLUDE(CMakeParseArguments)
# [STATIC_OUTPUT_NAME static_name]
# [RECOMPILE_FOR_EMBEDDED]
# [LINK_LIBRARIES lib1...libN]
-# [DEPENDENCIES target1...targetN]
+# [DEPENDS target1...targetN]
MACRO(MYSQL_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
- "LINK_LIBRARIES;DEPENDENCIES"
+ "LINK_LIBRARIES;DEPENDS"
${ARGN}
)
IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
@@ -111,8 +111,8 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF()
UNSET(${with_var} CACHE)
- IF(NOT ARG_DEPENDENCIES)
- SET(ARG_DEPENDENCIES)
+ IF(NOT ARG_DEPENDS)
+ SET(ARG_DEPENDS)
ENDIF()
IF(NOT ARG_MODULE_OUTPUT_NAME)
@@ -138,7 +138,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_LIBRARY(${target} STATIC ${SOURCES})
DTRACE_INSTRUMENT(${target})
- ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
+ ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
RESTRICT_SYMBOL_EXPORTS(${target})
IF(WITH_EMBEDDED_SERVER)
# Embedded library should contain PIC code and be linkable
@@ -152,7 +152,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
ENDIF()
- ADD_DEPENDENCIES(${target}_embedded GenError)
+ ADD_DEPENDENCIES(${target}_embedded GenError ${ARG_DEPENDS})
ENDIF()
ENDIF()
@@ -213,7 +213,7 @@ MACRO(MYSQL_ADD_PLUGIN)
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
ENDIF()
- ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
+ ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
@@ -256,15 +256,20 @@ MACRO(MYSQL_ADD_PLUGIN)
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
ENDIF()
- GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
- STRING(REGEX REPLACE "_LIBRARY$" "" plugin_type ${plugin_type})
- STRING(REGEX REPLACE "^NO$" "" plugin_type ${plugin_type})
+ IF(TARGET ${target})
+ GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
+ STRING(REPLACE "_LIBRARY" "" plugin_type ${plugin_type})
+ SET(have_target 1)
+ ELSE()
+ SET(plugin_type)
+ SET(have_target 0)
+ ENDIF()
IF(ARG_STORAGE_ENGINE)
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Storage Engine ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Storage Engine ${plugin_type}")
ELSEIF(ARG_CLIENT)
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Client plugin ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Client plugin ${plugin_type}")
ELSE()
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Server plugin ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Server plugin ${plugin_type}")
ENDIF()
ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
ENDMACRO()