From b082716892071fdc3c961e9afaa011e0f6beb102 Mon Sep 17 00:00:00 2001 From: Robert Bindar Date: Fri, 2 Jul 2021 09:34:25 +0300 Subject: MDEV-21206 Can't link zlib library during DBD::mysql installation mysql_config should never return -lzlib as linking flag. Clients trying to link against mariadb that use the output of mysql_config experience linking error because we return -lzlib when we don't ship any libzlib.a in our binary tarballs, bundled zlib static library is already linked. --- cmake/for_clients.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/for_clients.cmake b/cmake/for_clients.cmake index e5916c56ddc..e52e3b34f21 100644 --- a/cmake/for_clients.cmake +++ b/cmake/for_clients.cmake @@ -24,7 +24,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var) FOREACH(lib ${${target}_LIB_DEPENDS}) # Filter out "general", it is not a library, just CMake hint # Also, remove duplicates - IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ") + IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} " AND NOT lib STREQUAL "zlib") IF (lib MATCHES "^\\-") SET(${var} "${${var}} ${lib} ") ELSEIF(lib MATCHES "^/") -- cgit v1.2.1 From 751ebe44fda4deb715fc2235548517c287f2a559 Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Wed, 9 Aug 2017 21:39:18 +0200 Subject: Add feature summary at the end of cmake. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gives a short overview over found/missing dependencies as well as enabled/disabled features. Initial author Heinz Wiesinger Additions by Vicențiu Ciorbaru * Report all plugins enabled via MYSQL_ADD_PLUGIN * Simplify code. Eliminate duplication by making use of WITH_xxx variable values to set feature "ON" / "OFF" state. Reviewed by: wlad@mariadb.com (code details) serg@mariadb.com (the idea) --- cmake/jemalloc.cmake | 1 + cmake/numa.cmake | 1 + cmake/plugin.cmake | 16 +++++++++++++--- cmake/readline.cmake | 2 +- cmake/ssl.cmake | 1 + cmake/systemd.cmake | 1 + cmake/wsrep.cmake | 3 +++ 7 files changed, 21 insertions(+), 4 deletions(-) (limited to 'cmake') diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake index 5ad636d0e6c..08ab2877c89 100644 --- a/cmake/jemalloc.cmake +++ b/cmake/jemalloc.cmake @@ -37,5 +37,6 @@ MACRO (CHECK_JEMALLOC) IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto") MESSAGE(FATAL_ERROR "jemalloc is not found") ENDIF() + ADD_FEATURE_INFO(JEMALLOC LIBJEMALLOC "Use the JeMalloc memory allocator") ENDIF() ENDMACRO() diff --git a/cmake/numa.cmake b/cmake/numa.cmake index 4bace0ee7f4..a7b0c0a3392 100644 --- a/cmake/numa.cmake +++ b/cmake/numa.cmake @@ -31,6 +31,7 @@ MACRO (MYSQL_CHECK_NUMA) ENDIF() ENDIF() + ADD_FEATURE_INFO(NUMA HAVE_LIBNUMA "NUMA memory allocation policy") IF(WITH_NUMA AND NOT HAVE_LIBNUMA) # Forget it in cache, abort the build. UNSET(WITH_NUMA CACHE) diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 68eb715eed9..7a8eb97891e 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -49,7 +49,7 @@ MACRO(MYSQL_ADD_PLUGIN) LIST(REMOVE_AT SOURCES 0) STRING(TOUPPER ${plugin} plugin) STRING(TOLOWER ${plugin} target) - + IF (ARG_MANDATORY) UNSET(PLUGIN_${plugin} CACHE) SET(PLUGIN_${plugin} "YES") @@ -110,11 +110,11 @@ MACRO(MYSQL_ADD_PLUGIN) SET(with_var "WITH_${plugin}") ENDIF() UNSET(${with_var} CACHE) - + IF(NOT ARG_DEPENDENCIES) SET(ARG_DEPENDENCIES) ENDIF() - + IF(NOT ARG_MODULE_OUTPUT_NAME) IF(ARG_STORAGE_ENGINE) SET(ARG_MODULE_OUTPUT_NAME "ha_${target}") @@ -257,6 +257,16 @@ MACRO(MYSQL_ADD_PLUGIN) INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}") ENDIF() + GET_TARGET_PROPERTY(plugin_type ${target} TYPE) + STRING(REGEX REPLACE "_LIBRARY$" "" plugin_type ${plugin_type}) + STRING(REGEX REPLACE "^NO$" "" plugin_type ${plugin_type}) + IF(ARG_STORAGE_ENGINE) + ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Storage Engine ${plugin_type}") + ELSEIF(ARG_CLIENT) + ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Client plugin ${plugin_type}") + ELSE() + ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Server plugin ${plugin_type}") + ENDIF() ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT) ENDMACRO() diff --git a/cmake/readline.cmake b/cmake/readline.cmake index f676aeb7838..c423a8a830f 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -52,7 +52,7 @@ MACRO (MYSQL_CHECK_MULTIBYTE) ENDMACRO() MACRO (FIND_CURSES) - FIND_PACKAGE(Curses) + FIND_PACKAGE(Curses REQUIRED) MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H) IF(NOT CURSES_FOUND) SET(ERRORMSG "Curses library not found. Please install appropriate package, diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index d87d2c8fbd0..1b238826311 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -126,6 +126,7 @@ MACRO (MYSQL_CHECK_SSL) ENDIF() ENDIF() FIND_PACKAGE(OpenSSL) + SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE RECOMMENDED) IF(OPENSSL_FOUND) SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY}) SET(SSL_SOURCES "") diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 8a5695a246c..df10d6396df 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -63,5 +63,6 @@ MACRO(CHECK_SYSTEMD) ELSEIF(NOT WITH_SYSTEMD STREQUAL "no") MESSAGE(FATAL_ERROR "Invalid value for WITH_SYSTEMD. Must be 'yes', 'no', or 'auto'.") ENDIF() + ADD_FEATURE_INFO(SYSTEMD LIBSYSTEMD "Systemd scripts and notification support") ENDIF() ENDMACRO() diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index a1e8fc39fca..990198ecf72 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -41,3 +41,6 @@ SET(WSREP_PROC_INFO ${WITH_WSREP}) IF(WITH_WSREP) SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}") ENDIF() +IF (NOT WIN32) + ADD_FEATURE_INFO(WSREP WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)") +ENDIF() -- cgit v1.2.1