summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-08-03 09:50:22 +0200
committerSergei Golubchik <serg@mariadb.org>2021-08-03 10:10:00 +0200
commit175c9fe1d57daae2cf5fbc514cfffc27a55afcb0 (patch)
treeae40465dd34de3b5ee36b6fb78bfb19e73df6415
parentb549af69137023ce0f93d312a10d61e467dca07f (diff)
downloadmariadb-git-175c9fe1d57daae2cf5fbc514cfffc27a55afcb0.tar.gz
cleanup: specifying plugin dependencies in CMakeLists.txt
1. rename option DEPENDENCIES in MYSQL_ADD_PLUGIN() to DEPENDS to be consistent with other cmake commands and macros 2. use this DEPENDS option in plugins 3. add dependencies to the plugin embedded target too 4. plugins don't need to add GenError dependency explicitly, all plugins depend on it automatically
-rw-r--r--cmake/plugin.cmake14
-rw-r--r--storage/innobase/CMakeLists.txt4
-rw-r--r--storage/perfschema/CMakeLists.txt5
-rw-r--r--storage/xtradb/CMakeLists.txt1
4 files changed, 10 insertions, 14 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 7a8eb97891e..4184dc46648 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}")
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 08e8e3ff5ab..b965c4fbb45 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -188,7 +188,3 @@ IF(MSVC)
ENDIF()
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)
-
-IF(TARGET innobase)
- ADD_DEPENDENCIES(innobase GenError)
-ENDIF()
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 56083f24223..7ed365ea175 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -187,9 +187,10 @@ table_session_connect_attrs.cc
table_session_account_connect_attrs.cc
)
-MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY)
+MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT
+ STATIC_ONLY DEPENDS GenServerSource)
+
IF (TARGET perfschema)
- ADD_DEPENDENCIES(perfschema GenServerSource)
IF(WITH_UNIT_TESTS)
ADD_SUBDIRECTORY(unittest)
ENDIF(WITH_UNIT_TESTS)
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index bed5946541c..3408ff69a13 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -524,7 +524,6 @@ IF(TARGET xtradb)
IF(NOT XTRADB_OK)
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
ENDIF()
- ADD_DEPENDENCIES(xtradb GenError)
ENDIF()
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)