Skip to content

Commit 175c9fe

Browse files
committed
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
1 parent b549af6 commit 175c9fe

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

cmake/plugin.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ INCLUDE(CMakeParseArguments)
2626
# [STATIC_OUTPUT_NAME static_name]
2727
# [RECOMPILE_FOR_EMBEDDED]
2828
# [LINK_LIBRARIES lib1...libN]
29-
# [DEPENDENCIES target1...targetN]
29+
# [DEPENDS target1...targetN]
3030

3131
MACRO(MYSQL_ADD_PLUGIN)
3232
CMAKE_PARSE_ARGUMENTS(ARG
3333
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT"
3434
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
35-
"LINK_LIBRARIES;DEPENDENCIES"
35+
"LINK_LIBRARIES;DEPENDS"
3636
${ARGN}
3737
)
3838
IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
@@ -111,8 +111,8 @@ MACRO(MYSQL_ADD_PLUGIN)
111111
ENDIF()
112112
UNSET(${with_var} CACHE)
113113

114-
IF(NOT ARG_DEPENDENCIES)
115-
SET(ARG_DEPENDENCIES)
114+
IF(NOT ARG_DEPENDS)
115+
SET(ARG_DEPENDS)
116116
ENDIF()
117117

118118
IF(NOT ARG_MODULE_OUTPUT_NAME)
@@ -138,7 +138,7 @@ MACRO(MYSQL_ADD_PLUGIN)
138138

139139
ADD_LIBRARY(${target} STATIC ${SOURCES})
140140
DTRACE_INSTRUMENT(${target})
141-
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
141+
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
142142
RESTRICT_SYMBOL_EXPORTS(${target})
143143
IF(WITH_EMBEDDED_SERVER)
144144
# Embedded library should contain PIC code and be linkable
@@ -152,7 +152,7 @@ MACRO(MYSQL_ADD_PLUGIN)
152152
SET_TARGET_PROPERTIES(${target}_embedded
153153
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
154154
ENDIF()
155-
ADD_DEPENDENCIES(${target}_embedded GenError)
155+
ADD_DEPENDENCIES(${target}_embedded GenError ${ARG_DEPENDS})
156156
ENDIF()
157157
ENDIF()
158158

@@ -213,7 +213,7 @@ MACRO(MYSQL_ADD_PLUGIN)
213213
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
214214
ENDIF()
215215

216-
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
216+
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDS})
217217

218218
SET_TARGET_PROPERTIES(${target} PROPERTIES
219219
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")

storage/innobase/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,3 @@ IF(MSVC)
188188
ENDIF()
189189

190190
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)
191-
192-
IF(TARGET innobase)
193-
ADD_DEPENDENCIES(innobase GenError)
194-
ENDIF()

storage/perfschema/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ table_session_connect_attrs.cc
187187
table_session_account_connect_attrs.cc
188188
)
189189

190-
MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY)
190+
MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT
191+
STATIC_ONLY DEPENDS GenServerSource)
192+
191193
IF (TARGET perfschema)
192-
ADD_DEPENDENCIES(perfschema GenServerSource)
193194
IF(WITH_UNIT_TESTS)
194195
ADD_SUBDIRECTORY(unittest)
195196
ENDIF(WITH_UNIT_TESTS)

storage/xtradb/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ IF(TARGET xtradb)
524524
IF(NOT XTRADB_OK)
525525
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
526526
ENDIF()
527-
ADD_DEPENDENCIES(xtradb GenError)
528527
ENDIF()
529528

530529
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)

0 commit comments

Comments
 (0)