Commit 64d2849b authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-24292 support semi-independent versioning for sub-packages

1. specify plugin version in MYSQL_ADD_PLUGIN
parent 8de233af
......@@ -28,13 +28,14 @@ INCLUDE(CMakeParseArguments)
# [STATIC_OUTPUT_NAME static_name]
# [COMPONENT component]
# [CONFIG cnf_file_name]
# [VERSION version_string]
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
MACRO(MYSQL_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;VERSION"
"LINK_LIBRARIES;DEPENDENCIES"
${ARGN}
)
......@@ -117,6 +118,10 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(NOT ARG_DEPENDENCIES)
SET(ARG_DEPENDENCIES)
ENDIF()
IF(ARG_VERSION)
SET(version_string ";PLUGIN_${plugin}_VERSION=\"${ARG_VERSION}\"")
ENDIF()
IF(NOT ARG_MODULE_OUTPUT_NAME)
IF(ARG_STORAGE_ENGINE)
......@@ -153,7 +158,7 @@ MACRO(MYSQL_ADD_PLUGIN)
DTRACE_INSTRUMENT(${target}_embedded)
IF(ARG_RECOMPILE_FOR_EMBEDDED)
SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY${version_string}")
ENDIF()
ADD_DEPENDENCIES(${target}_embedded GenError)
ENDIF()
......@@ -204,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "")
IF (NOT ARG_CLIENT)
SET_TARGET_PROPERTIES (${target} PROPERTIES
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN${version_string}")
ENDIF()
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment