From 67cf76ad9b17f2825ac8759ead4928ed3d0f9ce7 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 18 Jan 2016 19:30:46 +0100 Subject: MDEV 4691- address review comments --- cmake/plugin.cmake | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'cmake/plugin.cmake') diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 9d24dacc7e1..95cf9e2cd6e 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -19,6 +19,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN # [STORAGE_ENGINE] +# [CLIENT] # [MANDATORY|DEFAULT] # [STATIC_ONLY|DYNAMIC_ONLY] # [MODULE_OUTPUT_NAME module_name] @@ -30,7 +31,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) MACRO(MYSQL_ADD_PLUGIN) MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" - "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" + "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT" ${ARGN} ) @@ -120,7 +121,7 @@ MACRO(MYSQL_ADD_PLUGIN) # Build either static library or module IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY - AND NOT ARG_DISABLED) + AND NOT ARG_DISABLED AND NOT ARG_CLIENT) IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja") # If there is a shared library from previous shared build, @@ -188,14 +189,14 @@ MACRO(MYSQL_ADD_PLUGIN) TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES}) - # Plugin uses symbols defined in mysqld executable. + # Server plugins use symbols defined in mysqld executable. # Some operating systems like Windows and OSX and are pretty strict about # unresolved symbols. Others are less strict and allow unresolved symbols # in shared libraries. On Linux for example, CMake does not even add # executable to the linker command line (it would result into link error). # Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate # an additional dependency. - IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ARG_CLIENT) TARGET_LINK_LIBRARIES (${target} mysqld) ENDIF() ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) @@ -206,19 +207,21 @@ MACRO(MYSQL_ADD_PLUGIN) IF(ARG_COMPONENT) IF(CPACK_COMPONENTS_ALL AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}) - SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) - - IF (NOT ARG_CONFIG) - SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") - FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") - ENDIF() - INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT}) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) + # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + + IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) + SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") + FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") + INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) + SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + ENDIF() ENDIF() ELSE() SET(ARG_COMPONENT Server) -- cgit v1.2.1 From 4bb62e91f6f93871106118f3ce47add4c109e208 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 20 Jan 2016 14:35:11 +0100 Subject: Do not require server RPM for client plugins --- cmake/plugin.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmake/plugin.cmake') diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 95cf9e2cd6e..cd4e4faaaf0 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -210,8 +210,9 @@ MACRO(MYSQL_ADD_PLUGIN) SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT}) SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) - + IF (NOT ARG_CLIENT) + SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) + ENDIF() # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) -- cgit v1.2.1 From a095c99301a0acac9b2db9b294f24a8753ebed48 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 26 Jan 2016 17:56:41 +0100 Subject: Fix packaging for client RPM plugins - provide 'ignored' list --- cmake/plugin.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmake/plugin.cmake') diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index cd4e4faaaf0..cd02bcfc4be 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -216,13 +216,13 @@ MACRO(MYSQL_ADD_PLUGIN) # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) - - IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) + SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) + IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") - INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) - SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) - ENDIF() + INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) + SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + ENDIF() ENDIF() ELSE() SET(ARG_COMPONENT Server) -- cgit v1.2.1