Commit 751ebe44 authored by Heinz Wiesinger's avatar Heinz Wiesinger Committed by Vicențiu Ciorbaru

Add feature summary at the end of cmake.

This gives a short overview over found/missing dependencies as well
as enabled/disabled features.

Initial author Heinz Wiesinger <heinz@m2mobi.com>
Additions by Vicențiu Ciorbaru <vicentiu@mariadb.org>
* 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)
parent 2b017367
......@@ -147,6 +147,7 @@ IF (NOT CPACK_GENERATOR)
ENDIF(WIN32)
ENDIF(NOT CPACK_GENERATOR)
INCLUDE(FeatureSummary)
INCLUDE(misc)
INCLUDE(mysql_version)
INCLUDE(cpack_source_ignore_files)
......@@ -418,11 +419,14 @@ ADD_SUBDIRECTORY(sql/share)
IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(sql)
OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
OPTION (WITH_EMBEDDED_SERVER "Compile MariaDB with embedded server" OFF)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER)
IF(NOT WIN32)
ADD_FEATURE_INFO(EMBEDDED_SERVER WITH_EMBEDDED_SERVER "Embedded MariaDB Server Library")
ENDIF()
IF(WITH_WSREP)
ADD_SUBDIRECTORY(wsrep)
......@@ -507,6 +511,13 @@ IF(WIN32 AND SIGNCODE)
INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/sign.cmake)
ENDIF()
FEATURE_SUMMARY(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES VAR MARIADB_FEATURE_SUMMARY)
OPTION(FEATURE_SUMMARY "Print feature summary at the end of configure step" ON)
IF (FEATURE_SUMMARY)
MESSAGE_ONCE(SUMMARY "${MARIADB_FEATURE_SUMMARY}")
ENDIF()
IF(NON_DISTRIBUTABLE_WARNING)
MESSAGE(WARNING "
You have linked MariaDB with ${NON_DISTRIBUTABLE_WARNING} libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with the Free Software Foundation.")
......
......@@ -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()
......@@ -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)
......
......@@ -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()
......
......@@ -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,
......
......@@ -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 "")
......
......@@ -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()
......@@ -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()
......@@ -161,6 +161,7 @@ IF(UNIX)
SET(LIBWRAP "wrap")
ENDIF()
ENDIF()
ADD_FEATURE_INFO(LIBWRAP HAVE_LIBWRAP "Support for tcp wrappers")
ENDIF()
#
......
......@@ -15,6 +15,7 @@
OPTION(WITH_MARIABACKUP "Include mariabackup" ON)
ADD_FEATURE_INFO(MARIABACKUP WITH_MARIABACKUP "MariaDB Backup Utility")
IF(NOT WITH_MARIABACKUP)
RETURN()
ENDIF()
......
......@@ -11,6 +11,7 @@ IF(USE_SSPI)
ELSE()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
FIND_PACKAGE(GSSAPI)
SET_PACKAGE_PROPERTIES(GSSAPI PROPERTIES TYPE OPTIONAL)
IF(GSSAPI_FOUND)
INCLUDE_DIRECTORIES(${GSSAPI_INCS})
ADD_DEFINITIONS(-DPLUGIN_GSSAPI)
......
......@@ -13,6 +13,7 @@
# or if plugin is explicitly requested to build. Then bail out.
MACRO(SKIP_AWS_PLUGIN msg)
MESSAGE_ONCE(SKIP_AWS_PLUGIN "Skip aws_key_management - ${msg}")
ADD_FEATURE_INFO(AWS_KEY_MANAGEMENT "OFF" "AWS Encryption Key Management Plugin")
RETURN()
ENDMACRO()
SET(CMAKE_CXX_STANDARD 11)
......@@ -76,6 +77,7 @@ ELSE()
INCLUDE(ExternalProject)
IF(UNIX)
FIND_PACKAGE(CURL)
SET_PACKAGE_PROPERTIES(CURL PROPERTIES TYPE REQUIRED)
IF(NOT CURL_FOUND)
SKIP_AWS_PLUGIN("AWS C++ SDK requires libcurl development package")
ENDIF()
......@@ -86,10 +88,12 @@ ELSE()
ENDIF()
IF(NOT APPLE)
FIND_LIBRARY(UUID_LIBRARIES uuid)
SET_PACKAGE_PROPERTIES(UUID_LIBRARIES PROPERTIES TYPE REQUIRED)
IF(NOT UUID_LIBRARIES)
SKIP_AWS_PLUGIN("AWS C++ SDK requires uuid development package")
ENDIF()
FIND_PACKAGE(OpenSSL)
SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE REQUIRED)
IF(NOT OPENSSL_FOUND)
SKIP_AWS_PLUGIN("AWS C++ SDK requires openssl development package")
ENDIF()
......@@ -170,5 +174,7 @@ MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc
COMPONENT aws-key-management)
IF (TARGET aws_key_management)
SET(NON_DISTRIBUTABLE_WARNING "Apache 2.0" PARENT_SCOPE)
SET(NON_DISTRIBUTABLE_WARNING "Apache 2.0" PARENT_SCOPE)
ENDIF()
ADD_FEATURE_INFO(AWS_KEY_MANAGEMENT "ON" "AWS Encryption Key Management Plugin")
......@@ -29,7 +29,7 @@ IF(WIN32)
MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS}
LINK_LIBRARIES Secur32
MODULE_ONLY COMPONENT ClientPlugins)
MODULE_ONLY COMPONENT ClientPlugins CLIENT)
#IF(MSVC)
# INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug)
......
......@@ -108,6 +108,7 @@ IF(CONNECT_WITH_VCT)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} filamvct.cpp tabvct.cpp filamvct.h tabvct.h)
add_definitions(-DVCT_SUPPORT)
ENDIF(CONNECT_WITH_VCT)
ADD_FEATURE_INFO(CONNECT_VCT CONNECT_WITH_VCT "Support for VCT in the CONNECT storage engine")
#
......@@ -133,6 +134,7 @@ IF(CONNECT_WITH_LIBXML2)
D:/libxml/lib)
ENDIF(WIN32)
FIND_PACKAGE(LibXml2)
SET_PACKAGE_PROPERTIES(LibXml2 PROPERTIES TYPE OPTIONAL)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
......@@ -140,6 +142,8 @@ IF(CONNECT_WITH_LIBXML2)
add_definitions(-DLIBXML2_SUPPORT)
ENDIF(LIBXML2_FOUND)
ENDIF(CONNECT_WITH_LIBXML2)
ADD_FEATURE_INFO(CONNECT_LIBXML2 CONNECT_WITH_LIBXML2
"Support for LIBXML2 in the CONNECT storage engine")
IF(WIN32)
......@@ -153,6 +157,8 @@ IF(WIN32)
SET(MSXML_FOUND 1)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h)
ENDIF(CONNECT_WITH_MSXML)
ADD_FEATURE_INFO(CONNECT_MSXML CONNECT_WITH_MSXML
"Support for MSXML in the CONNECT storage engine")
ENDIF(WIN32)
IF(LIBXML2_FOUND OR MSXML_FOUND)
......@@ -253,6 +259,7 @@ int main() {
tabodbc.cpp tabodbc.h odbccat.h odbconn.cpp odbconn.h)
ENDIF(UNIX)
ENDIF(CONNECT_WITH_ODBC)
ADD_FEATURE_INFO(CONNECT_ODBC ODBC_LIBRARY "Support for ODBC in the CONNECT storage engine")
#
# JDBC with MongoDB Java Driver included but disabled if without MONGO
......@@ -262,7 +269,9 @@ OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)
IF(CONNECT_WITH_JDBC)
FIND_PACKAGE(Java 1.6)
SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL)
FIND_PACKAGE(JNI)
SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL)
IF (JAVA_FOUND AND JNI_FOUND)
INCLUDE(UseJava)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH})
......@@ -278,6 +287,7 @@ IF(CONNECT_WITH_JDBC)
Mongo2Interface.java Mongo3Interface.java
mysql-test/connect/std_data/JavaWrappers.jar)
add_definitions(-DJAVA_SUPPORT)
ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine")
IF(CONNECT_WITH_MONGO)
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
mysql-test/connect/std_data/Mongo2.jar
......@@ -286,7 +296,10 @@ IF(CONNECT_WITH_JDBC)
ENDIF()
ELSE()
SET(JDBC_LIBRARY "")
ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine")
ENDIF()
ELSE(CONNECT_WITH_JDBC)
ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine")
ENDIF(CONNECT_WITH_JDBC)
#
......@@ -300,6 +313,7 @@ IF(CONNECT_WITH_ZIP)
filamzip.h tabzip.h ioapi.h unzip.h zip.h)
add_definitions(-DZIP_SUPPORT -DNOCRYPT)
ENDIF(CONNECT_WITH_ZIP)
ADD_FEATURE_INFO(CONNECT_ZIP CONNECT_WITH_ZIP "Support for ZIP in the CONNECT storage engine")
#
# MONGO C Driver
......@@ -316,6 +330,7 @@ IF(CONNECT_WITH_MONGO)
D:/mongo-c-driver/lib)
ENDIF(WIN32)
FIND_PACKAGE(libmongoc-1.0 1.7 QUIET)
SET_PACKAGE_PROPERTIES(libmongoc PROPERTIES TYPE OPTIONAL)
IF (libmongoc-1.0_FOUND)
INCLUDE_DIRECTORIES(${MONGOC_INCLUDE_DIRS})
SET(MONGOC_LIBRARY ${MONGOC_LIBRARIES})
......@@ -323,14 +338,18 @@ IF(CONNECT_WITH_MONGO)
cmgoconn.cpp cmgfam.cpp tabcmg.cpp
cmgoconn.h cmgfam.h tabcmg.h)
add_definitions(-DCMGO_SUPPORT)
ADD_FEATURE_INFO(CONNECT_MONGODB "ON" "Support for MongoDB in the CONNECT storage engine")
IF (NOT JAVA_FOUND AND JNI_FOUND)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
add_definitions(-DMONGO_SUPPORT)
ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
ELSE(libmongoc-1.0_FOUND)
ADD_FEATURE_INFO(CONNECT_MONGODB "OFF" "Support for MongoDB in the CONNECT storage engine")
ENDIF(libmongoc-1.0_FOUND)
ELSE(CONNECT_WITH_MONGO)
ADD_FEATURE_INFO(CONNECT_MONGODB "OFF" "Support for MongoDB in the CONNECT storage engine")
ENDIF(CONNECT_WITH_MONGO)
#
# REST
#
......@@ -362,6 +381,7 @@ IF(CONNECT_WITH_REST)
## MESSAGE(STATUS "=====> cpprestsdk package not found")
# ENDIF (cpprestsdk_FOUND)
ENDIF(CONNECT_WITH_REST)
ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
#
# XMAP
......@@ -372,6 +392,7 @@ OPTION(CONNECT_WITH_XMAP "Compile CONNECT storage engine with index file mapping
IF(CONNECT_WITH_XMAP)
add_definitions(-DXMAP)
ENDIF(CONNECT_WITH_XMAP)
ADD_FEATURE_INFO(CONNECT_XMAP CONNECT_WITH_XMAP "Support for index file mapping in the CONNECT storage engine")
#
# Plugin definition
......
......@@ -22,12 +22,15 @@ MACRO (MYSQL_CHECK_BZIP2)
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS)
IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H)
SET(HAVE_INNODB_BZLIB2 TRUE)
ADD_DEFINITIONS(-DHAVE_BZIP2=1)
LINK_LIBRARIES(bz2)
ELSE()
IF (WITH_INNODB_BZIP2 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
ENDIF()
ENDIF()
ENDIF()
ADD_FEATURE_INFO(INNODB_BZIP2 HAVE_INNODB_BZLIB2
"BZIP2 compression in the InnoDB storage engine")
ENDMACRO()
......@@ -86,6 +86,7 @@ MARK_AS_ADVANCED(INNODB_COMPILER_HINTS)
IF(INNODB_COMPILER_HINTS)
ADD_DEFINITIONS("-DCOMPILER_HINTS")
ENDIF()
ADD_FEATURE_INFO(INNODB_COMPILER_HINTS INNODB_COMPILER_HINTS "InnoDB compiled with compiler hints")
SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex")
......@@ -121,15 +122,20 @@ IF(WITH_INNODB_AHI)
ADD_DEFINITIONS(-DBTR_CUR_HASH_ADAPT -DBTR_CUR_ADAPT)
IF(NOT WITH_INNODB_ROOT_GUESS)
MESSAGE(WARNING "WITH_INNODB_AHI implies WITH_INNODB_ROOT_GUESS")
SET(WITH_INNODB_ROOT_GUESS ON)
ENDIF()
ELSEIF(WITH_INNODB_ROOT_GUESS)
ADD_DEFINITIONS(-DBTR_CUR_ADAPT)
ENDIF()
ADD_FEATURE_INFO(INNODB_AHI WITH_INNODB_AHI "InnoDB Adaptive Hash Index")
ADD_FEATURE_INFO(INNODB_ROOT_GUESS WITH_INNODB_ROOT_GUESS
"Cache index root block descriptors in InnoDB")
OPTION(WITH_INNODB_BUG_ENDIAN_CRC32 "Weaken innodb_checksum_algorithm=crc32 by supporting upgrade from big-endian systems running 5.6/10.0/10.1" ${IS_BIG_ENDIAN})
IF(WITH_INNODB_BUG_ENDIAN_CRC32)
ADD_DEFINITIONS(-DINNODB_BUG_ENDIAN_CRC32)
ENDIF()
ADD_FEATURE_INFO(INNODB_BUG_ENDIAN_CRC32 WITH_INNODB_BUG_ENDIAN_CRC32 "Big endian weaker CRC32 to support upgrade from big-endian systems running 5.6/10.0/10.1")
OPTION(WITH_INNODB_EXTRA_DEBUG "Enable extra InnoDB debug checks" OFF)
IF(WITH_INNODB_EXTRA_DEBUG)
......@@ -148,6 +154,8 @@ IF(WITH_INNODB_EXTRA_DEBUG)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}")
ENDIF()
ADD_FEATURE_INFO(INNODB_EXTRA_DEBUG WITH_INNODB_EXTRA_DEBUG "Extra InnoDB debug checks")
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(HAVE_SCHED_GETCPU)
......@@ -239,6 +247,7 @@ OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WI
IF (WITH_INNODB_DISALLOW_WRITES)
ADD_DEFINITIONS(-DWITH_INNODB_DISALLOW_WRITES)
ENDIF()
ADD_FEATURE_INFO(INNODB_DISALLOW_WRITES WITH_INNODB_DISALLOW_WRITES "Expose innodb_disallow_writes switch to stop innodb from writing to disk")
# Include directories under innobase
......@@ -281,8 +290,8 @@ IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/lexyy.c
PROPERTIES COMPILE_FLAGS "/wd4003")
ENDIF()
# Include directories under innobase
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include
${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/libbinlogevents/include )
......@@ -22,15 +22,17 @@ MACRO (MYSQL_CHECK_LZ4)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
SET(HAVE_INNODB_LZ4 TRUE)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(lz4)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lz4 library is not found")
MESSAGE(FATAL_ERROR "Required lz4 library is not found")
ENDIF()
ENDIF()
ENDIF()
ADD_FEATURE_INFO(INNODB_LZ4 HAVE_INNODB_LZ4 "LZ4 compression in the InnoDB storage engine")
ENDMACRO()
......@@ -22,12 +22,14 @@ MACRO (MYSQL_CHECK_LZMA)
CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE)
IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H)
SET(HAVE_INNODB_LZMA TRUE)
ADD_DEFINITIONS(-DHAVE_LZMA=1)
LINK_LIBRARIES(lzma)
ELSE()
IF (WITH_INNODB_LZMA STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lzma library is not found")
MESSAGE(FATAL_ERROR "Required lzma library is not found")
ENDIF()
ENDIF()
ENDIF()
ADD_FEATURE_INFO(INNODB_LZMA HAVE_INNODB_LZMA "LZMA compression in the InnoDB storage engine")
ENDMACRO()
......@@ -21,12 +21,14 @@ MACRO (MYSQL_CHECK_LZO)
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB)
IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
SET(HAVE_INNODB_LZO TRUE)
ADD_DEFINITIONS(-DHAVE_LZO=1)
LINK_LIBRARIES(lzo2)
ELSE()
IF (WITH_INNODB_LZO STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lzo library is not found")
MESSAGE(FATAL_ERROR "Required lzo library is not found")
ENDIF()
ENDIF()
ENDIF()
ADD_FEATURE_INFO(INNODB_LZO HAVE_INNODB_LZO "LZO compression in the InnoDB storage engine")
ENDMACRO()
......@@ -21,12 +21,14 @@ MACRO (MYSQL_CHECK_SNAPPY)
CHECK_LIBRARY_EXISTS(snappy snappy_uncompress "" HAVE_SNAPPY_SHARED_LIB)
IF(HAVE_SNAPPY_SHARED_LIB AND HAVE_SNAPPY_H)
SET(HAVE_INNODB_SNAPPY TRUE)
ADD_DEFINITIONS(-DHAVE_SNAPPY=1)
LINK_LIBRARIES(snappy)
ELSE()
IF (WITH_INNODB_SNAPPY STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required snappy library is not found")
MESSAGE(FATAL_ERROR "Required snappy library is not found")
ENDIF()
ENDIF()
ENDIF()
ADD_FEATURE_INFO(INNODB_SNAPPY HAVE_INNODB_SNAPPY "Snappy compression in the InnoDB storage engine")
ENDMACRO()
......@@ -3,6 +3,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
FUNCTION(CHECK_OQGRAPH)
MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost 1.40.0)
SET_PACKAGE_PROPERTIES(Boost PROPERTIES
PURPOSE "Required for the OQGraph storage engine"
TYPE OPTIONAL
)
IF(NOT Boost_FOUND)
MESSAGE(STATUS "Boost not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
......@@ -11,6 +15,10 @@ ENDIF()
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
FIND_PACKAGE(Judy)
SET_PACKAGE_PROPERTIES(Judy PROPERTIES
PURPOSE "Required for the OQGraph storage engine"
TYPE OPTIONAL
)
IF(NOT Judy_FOUND)
MESSAGE(STATUS "Judy not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
......
......@@ -2,6 +2,7 @@
MACRO(SKIP_ROCKSDB_PLUGIN msg)
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")
ADD_FEATURE_INFO(ROCKSDB "OFF" "Storage Engine")
RETURN()
ENDMACRO()
......
......@@ -48,22 +48,28 @@ foreach(compression_lib LZ4 BZip2 ZSTD snappy)
endforeach()
if(LZ4_FOUND AND (NOT WITH_ROCKSDB_LZ4 STREQUAL "OFF"))
set(HAVE_ROCKSDB_LZ4 TRUE)
add_definitions(-DLZ4)
include_directories(${LZ4_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARY})
endif()
ADD_FEATURE_INFO(ROCKSDB_LZ4 HAVE_ROCKSDB_LZ4 "LZ4 Compression in the RocksDB storage engine")
if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZip2 STREQUAL "OFF"))
set(HAVE_ROCKSDB_BZIP2 TRUE)
add_definitions(-DBZIP2)
include_directories(${BZIP2_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
endif()
ADD_FEATURE_INFO(ROCKSDB_BZIP2 HAVE_ROCKSDB_BZIP2 "BZIP2 Compression in the RocksDB storage engine")
if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_snappy STREQUAL "OFF"))
set(HAVE_ROCKSDB_SNAPPY TRUE)
add_definitions(-DSNAPPY)
include_directories(${snappy_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${snappy_LIBRARIES})
endif()
ADD_FEATURE_INFO(ROCKSDB_SNAPPY HAVE_ROCKSDB_SNAPPY "Snappy Compression in the RocksDB storage engine")
include(CheckFunctionExists)
if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
......@@ -75,14 +81,17 @@ if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
"WITH_ROCKSDB_ZSTD is ON and ZSTD library was found, but the version needs to be >= 1.1.3")
endif()
if (ZSTD_VALID)
set(HAVE_ROCKSDB_ZSTD TRUE)
add_definitions(-DZSTD)
include_directories(${ZSTD_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${ZSTD_LIBRARY})
endif()
endif()
ADD_FEATURE_INFO(ROCKSDB_ZSTD HAVE_ROCKSDB_ZSTD "Zstandard Compression in the RocksDB storage engine")
add_definitions(-DZLIB)
list(APPEND THIRDPARTY_LIBS ${ZLIB_LIBRARY})
ADD_FEATURE_INFO(ROCKSDB_ZLIB "ON" "zlib Compression in the RocksDB storage engine")
if(CMAKE_SYSTEM_NAME MATCHES "Cygwin")
add_definitions(-fno-builtin-memcmp -DCYGWIN)
......
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