Skip to content

Commit 64d2849

Browse files
committed
MDEV-24292 support semi-independent versioning for sub-packages
1. specify plugin version in MYSQL_ADD_PLUGIN
1 parent 8de233a commit 64d2849

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cmake/plugin.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ INCLUDE(CMakeParseArguments)
2828
# [STATIC_OUTPUT_NAME static_name]
2929
# [COMPONENT component]
3030
# [CONFIG cnf_file_name]
31+
# [VERSION version_string]
3132
# [LINK_LIBRARIES lib1...libN]
3233
# [DEPENDENCIES target1...targetN]
3334

3435
MACRO(MYSQL_ADD_PLUGIN)
3536
CMAKE_PARSE_ARGUMENTS(ARG
3637
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
37-
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
38+
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;VERSION"
3839
"LINK_LIBRARIES;DEPENDENCIES"
3940
${ARGN}
4041
)
@@ -117,6 +118,10 @@ MACRO(MYSQL_ADD_PLUGIN)
117118
IF(NOT ARG_DEPENDENCIES)
118119
SET(ARG_DEPENDENCIES)
119120
ENDIF()
121+
122+
IF(ARG_VERSION)
123+
SET(version_string ";PLUGIN_${plugin}_VERSION=\"${ARG_VERSION}\"")
124+
ENDIF()
120125

121126
IF(NOT ARG_MODULE_OUTPUT_NAME)
122127
IF(ARG_STORAGE_ENGINE)
@@ -153,7 +158,7 @@ MACRO(MYSQL_ADD_PLUGIN)
153158
DTRACE_INSTRUMENT(${target}_embedded)
154159
IF(ARG_RECOMPILE_FOR_EMBEDDED)
155160
SET_TARGET_PROPERTIES(${target}_embedded
156-
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
161+
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY${version_string}")
157162
ENDIF()
158163
ADD_DEPENDENCIES(${target}_embedded GenError)
159164
ENDIF()
@@ -204,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
204209
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "")
205210
IF (NOT ARG_CLIENT)
206211
SET_TARGET_PROPERTIES (${target} PROPERTIES
207-
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
212+
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN${version_string}")
208213
ENDIF()
209214

210215
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})

0 commit comments

Comments
 (0)