Commit 787ec317 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6248 GUI-friendly cmake options to enable/disable plugins

* Introduce a set of PLUGIN_xxx cmake options with values
  NO, STATIC, DYNAMIC, AUTO, YES (abort if plugin is not compiled)
* Deprecate redundant and ambiguous WITH_xxx, WITH_PLUGIN_xxx,
  WITH_xxx_STORAGE_ENGINE, WITHOUT_xxx, WITHOUT_PLUGIN_xxx,
  WITHOUT_xxx_STORAGE_ENGINE
* Actually check whether a plugin is disabled (DISABLED keyword was
  always present, but it was ignored until now).
* Support conditionally disabled plugins - keyword ONLY_IF
* Use ONLY_IF for conditionally skipping plugins, instead of
  doing MYSQL_ADD_PLUGIN conditionally as before. Because if
  MYSQL_ADD_PLUGIN isn't done at all, PLUGIN_xxx=YES cannot work.
parent da9bb66b
...@@ -46,8 +46,6 @@ SET(FEATURE_SET_large 5) ...@@ -46,8 +46,6 @@ SET(FEATURE_SET_large 5)
SET(FEATURE_SET_xlarge 6) SET(FEATURE_SET_xlarge 6)
SET(FEATURE_SET_community 7) SET(FEATURE_SET_community 7)
#SET(WITH_CASSANDRA_STORAGE_ENGINE ON)
IF(FEATURE_SET) IF(FEATURE_SET)
STRING(TOLOWER ${FEATURE_SET} feature_set) STRING(TOLOWER ${FEATURE_SET} feature_set)
SET(num ${FEATURE_SET_${feature_set}}) SET(num ${FEATURE_SET_${feature_set}})
...@@ -56,7 +54,7 @@ IF(FEATURE_SET) ...@@ -56,7 +54,7 @@ IF(FEATURE_SET)
Should be xsmall, small, classic, large, or community Should be xsmall, small, classic, large, or community
") ")
ENDIF() ENDIF()
SET(WITH_PARTITION_STORAGE_ENGINE OFF) SET(PLUGIN_PARTITION "NO")
IF(num EQUAL FEATURE_SET_xsmall) IF(num EQUAL FEATURE_SET_xsmall)
SET(WITH_NONE ON) SET(WITH_NONE ON)
ENDIF() ENDIF()
...@@ -65,34 +63,23 @@ IF(FEATURE_SET) ...@@ -65,34 +63,23 @@ IF(FEATURE_SET)
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "") SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
ENDIF() ENDIF()
IF(num GREATER FEATURE_SET_small) IF(num GREATER FEATURE_SET_small)
SET(WITH_ARCHIVE_STORAGE_ENGINE ON) SET(PLUGIN_ARCHIVE "STATIC")
SET(WITH_BLACKHOLE_STORAGE_ENGINE ON) SET(PLUGIN_BLACKHOLE "STATIC")
SET(WITH_FEDERATEDX_STORAGE_ENGINE ON) SET(PLUGIN_FEDERATEDX "STATIC")
SET(WITH_PLUGIN_FEEDBACK ON) SET(PLUGIN_FEEDBACK "STATIC")
ENDIF() ENDIF()
IF(num GREATER FEATURE_SET_classic) IF(num GREATER FEATURE_SET_classic)
SET(WITH_INNOBASE_STORAGE_ENGINE ON) SET(PLUGIN_INNOBASE "STATIC")
ENDIF() ENDIF()
IF(num GREATER FEATURE_SET_large) IF(num GREATER FEATURE_SET_large)
SET(WITH_PARTITION_STORAGE_ENGINE ON) SET(PLUGIN_PARTITION "STATIC")
#SET(PLUGIN_CASSANDRA "STATIC")
ENDIF() ENDIF()
IF(num GREATER FEATURE_SET_xlarge) IF(num GREATER FEATURE_SET_xlarge)
# OPTION(WITH_ALL ON) # OPTION(WITH_ALL ON)
# better no set this, otherwise server would be linked # better no set this, otherwise server would be linked
# statically with experimental stuff like audit_null # statically with experimental stuff like audit_null
ENDIF() ENDIF()
# Update cache with current values, remove engines we do not care about
# from build.
FOREACH(eng ARCHIVE BLACKHOLE FEDERATED INNOBASE PARTITION)
IF(NOT WITH_${eng}_STORAGE_ENGINE)
SET(WITHOUT_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
MARK_AS_ADVANCED(WITHOUT_${eng}_STORAGE_ENGINE)
SET(WITH_${eng}_STORAGE_ENGINE OFF CACHE BOOL "")
ELSE()
SET(WITH_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
ENDIF()
ENDFOREACH()
ENDIF() ENDIF()
OPTION(ENABLED_LOCAL_INFILE "" ON) OPTION(ENABLED_LOCAL_INFILE "" ON)
......
...@@ -29,7 +29,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) ...@@ -29,7 +29,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO(MYSQL_ADD_PLUGIN) MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;ONLY_IF"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN} ${ARGN}
) )
...@@ -47,44 +47,57 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -47,44 +47,57 @@ MACRO(MYSQL_ADD_PLUGIN)
STRING(TOUPPER ${plugin} plugin) STRING(TOUPPER ${plugin} plugin)
STRING(TOLOWER ${plugin} target) STRING(TOLOWER ${plugin} target)
# Figure out whether to build plugin IF (ARG_MANDATORY)
IF(WITH_PLUGIN_${plugin}) UNSET(PLUGIN_${plugin} CACHE)
SET(WITH_${plugin} 1) SET(PLUGIN_${plugin} "YES")
ENDIF() ELSE()
SET (compat ".")
IF(WITH_MAX_NO_NDB) # Figure out whether to build plugin.
SET(WITH_MAX 1) # recognize and support the maze of old WITH/WITHOUT combinations
SET(WITHOUT_NDBCLUSTER 1) IF(WITHOUT_${plugin}_STORAGE_ENGINE
ENDIF() OR WITHOUT_${plugin}
OR WITHOUT_PLUGIN_${plugin}
OR WITH_NONE)
IF(ARG_DEFAULT) SET(compat "${compat}without")
IF(NOT DEFINED WITH_${plugin} AND
NOT DEFINED WITH_${plugin}_STORAGE_ENGINE)
SET(WITH_${plugin} 1)
ENDIF() ENDIF()
ENDIF()
IF(WITH_${plugin}_STORAGE_ENGINE IF(WITH_${plugin}_STORAGE_ENGINE
OR WITH_{$plugin} OR WITH_${plugin}
OR WITH_PLUGIN_${plugin}
OR WITH_ALL OR WITH_ALL
OR WITH_MAX OR WITH_MAX
AND NOT WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_MAX_NO_NDB
AND NOT WITHOUT_${plugin} OR ARG_DEFAULT)
AND NOT ARG_MODULE_ONLY)
SET(WITH_${plugin} 1) SET(compat "with${compat}")
ELSEIF(WITHOUT_${plugin} OR WITHOUT_${plugin}_STORAGE_ENGINE OR
WITH_NONE OR ${plugin}_DISABLED)
SET(WITHOUT_${plugin} 1)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITH_${plugin} 0)
ENDIF() ENDIF()
IF (compat STREQUAL ".")
SET(howtobuild DYNAMIC)
ELSEIF (compat STREQUAL "with.")
IF (NOT ARG_MODULE_ONLY)
SET(howtobuild STATIC)
ELSE()
SET(howtobuild DYNAMIC)
ENDIF()
ELSEIF (compat STREQUAL ".without")
SET(howtobuild NO)
ELSEIF (compat STREQUAL "with.without")
SET(howtobuild STATIC)
ENDIF()
IF(ARG_MANDATORY) # NO - not at all
SET(WITH_${plugin} 1) # YES - static if possible, otherwise dynamic if possible, otherwise abort
# AUTO - static if possible, otherwise dynamic, if possible
# STATIC - static if possible, otherwise not at all
# DYNAMIC - dynamic if possible, otherwise not at all
SET(PLUGIN_${plugin} ${howtobuild}
CACHE STRING "How to build plugin ${plugin}. Options are: NO STATIC DYNAMIC YES AUTO.")
ENDIF() ENDIF()
IF (NOT PLUGIN_${plugin} MATCHES "^(NO|YES|AUTO|STATIC|DYNAMIC)$")
MESSAGE(FATAL_ERROR "Invalid value for PLUGIN_${plugin}")
ENDIF()
IF(ARG_STORAGE_ENGINE) IF(ARG_STORAGE_ENGINE)
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" ) SET(with_var "WITH_${plugin}_STORAGE_ENGINE" )
...@@ -95,7 +108,6 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -95,7 +108,6 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(NOT ARG_DEPENDENCIES) IF(NOT ARG_DEPENDENCIES)
SET(ARG_DEPENDENCIES) SET(ARG_DEPENDENCIES)
ENDIF() ENDIF()
SET(BUILD_PLUGIN 1)
IF(NOT ARG_MODULE_OUTPUT_NAME) IF(NOT ARG_MODULE_OUTPUT_NAME)
IF(ARG_STORAGE_ENGINE) IF(ARG_STORAGE_ENGINE)
...@@ -105,8 +117,13 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -105,8 +117,13 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(ARG_ONLY_IF AND NOT ${ARG_ONLY_IF})
SET(ARG_DISABLED 1)
ENDIF()
# Build either static library or module # Build either static library or module
IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY) IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY
AND NOT ARG_DISABLED)
IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja") IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
# If there is a shared library from previous shared build, # If there is a shared library from previous shared build,
...@@ -142,17 +159,15 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -142,17 +159,15 @@ MACRO(MYSQL_ADD_PLUGIN)
OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME}) OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
ENDIF() ENDIF()
IF(ARG_LINK_LIBRARIES)
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
ENDIF()
# Update mysqld dependencies # Update mysqld dependencies
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS} SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE) ${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
IF(ARG_MANDATORY) SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server" FORCE)
SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server"
FORCE)
ELSE()
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
ENDIF()
IF(ARG_MANDATORY) IF(ARG_MANDATORY)
SET (mysql_mandatory_plugins SET (mysql_mandatory_plugins
...@@ -163,14 +178,16 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -163,14 +178,16 @@ MACRO(MYSQL_ADD_PLUGIN)
"${mysql_optional_plugins} builtin_maria_${target}_plugin,") "${mysql_optional_plugins} builtin_maria_${target}_plugin,")
SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE) SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF() ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS) ELSEIF(PLUGIN_${plugin} MATCHES "(DYNAMIC|AUTO|YES)"
AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS
AND NOT ARG_DISABLED)
ADD_VERSION_INFO(${target} MODULE SOURCES) ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES}) ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target}) DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
TARGET_LINK_LIBRARIES (${target} mysqlservices) TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})
# Plugin uses symbols defined in mysqld executable. # Plugin uses symbols defined in mysqld executable.
# Some operating systems like Windows and OSX and are pretty strict about # Some operating systems like Windows and OSX and are pretty strict about
...@@ -180,15 +197,12 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -180,15 +197,12 @@ MACRO(MYSQL_ADD_PLUGIN)
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate # Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
# an additional dependency. # an additional dependency.
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES}) TARGET_LINK_LIBRARIES (${target} mysqld)
ENDIF() ENDIF()
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(NOT ARG_MODULE_ONLY) UNSET(${with_var} CACHE)
# set cached variable, e.g with checkbox in GUI
SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
ENDIF()
SET_TARGET_PROPERTIES(${target} PROPERTIES SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library # Install dynamic library
...@@ -213,18 +227,8 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -213,18 +227,8 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF() ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT}) MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT})
#INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT}) #INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT})
ELSE() ELSEIF(PLUGIN_${plugin} MATCHES "YES")
IF(WITHOUT_${plugin}) MESSAGE(FATAL_ERROR "Plugin ${plugin} cannot be built")
# Update cache variable
STRING(REPLACE "WITH_" "WITHOUT_" without_var ${with_var})
SET(${without_var} ON CACHE BOOL "Don't build ${plugin}"
FORCE)
ENDIF()
SET(BUILD_PLUGIN 0)
ENDIF()
IF(BUILD_PLUGIN AND ARG_LINK_LIBRARIES)
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
ENDIF() ENDIF()
GET_FILENAME_COMPONENT(subpath ${CMAKE_CURRENT_SOURCE_DIR} NAME) GET_FILENAME_COMPONENT(subpath ${CMAKE_CURRENT_SOURCE_DIR} NAME)
......
...@@ -72,7 +72,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") ...@@ -72,7 +72,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
# Add path to the InnoDB headers # Add path to the InnoDB headers
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include)
# We use the InnoDB code directly in case the code changes. # We use the InnoDB code directly in case the code changes.
......
...@@ -4,10 +4,10 @@ INCLUDE (CheckFunctionExists) ...@@ -4,10 +4,10 @@ INCLUDE (CheckFunctionExists)
CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H) CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H)
CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP) CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP)
IF(HAVE_PAM_APPL_H) IF(HAVE_STRNDUP)
IF(HAVE_STRNDUP)
ADD_DEFINITIONS(-DHAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP)
ENDIF(HAVE_STRNDUP) ENDIF(HAVE_STRNDUP)
MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY)
ENDIF(HAVE_PAM_APPL_H) MYSQL_ADD_PLUGIN(auth_pam auth_pam.c ONLY_IF HAVE_PAM_APPL_H
LINK_LIBRARIES pam MODULE_ONLY)
...@@ -35,5 +35,8 @@ IF (NOT HAVE_PEERCRED) ...@@ -35,5 +35,8 @@ IF (NOT HAVE_PEERCRED)
ENDIF() ENDIF()
IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED) IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED)
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY) SET(AUTH_SOCKET_OK 1)
ENDIF() ENDIF()
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c ONLY_IF AUTH_SOCKET_OK MODULE_ONLY)
...@@ -14,10 +14,10 @@ IF(HAVE_NETDB_H) ...@@ -14,10 +14,10 @@ IF(HAVE_NETDB_H)
ENDIF(HAVE_NETDB_H) ENDIF(HAVE_NETDB_H)
IF(WIN32) IF(WIN32)
MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES} SET(MAYBE_STATIC_ONLY STATIC_ONLY)
LINK_LIBRARIES ${SSL_LIBRARIES}
STATIC_ONLY DEFAULT)
ELSE(WIN32)
MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES}
LINK_LIBRARIES ${SSL_LIBRARIES})
ENDIF(WIN32) ENDIF(WIN32)
MYSQL_ADD_PLUGIN(FEEDBACK ${FEEDBACK_SOURCES}
LINK_LIBRARIES ${SSL_LIBRARIES}
${MAYBE_STATIC_ONLY} DEFAULT)
...@@ -17,18 +17,14 @@ MARK_AS_ADVANCED(Thrift_LIBS Thrift_INCLUDE_DIRS) ...@@ -17,18 +17,14 @@ MARK_AS_ADVANCED(Thrift_LIBS Thrift_INCLUDE_DIRS)
IF(EXISTS ${Thrift_LIBS}) IF(EXISTS ${Thrift_LIBS})
GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE) GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE)
ELSE() INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS}/..)
RETURN() SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
ENDIF()
INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS}/..)
SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_REQUIRED_INCLUDES "${Thrift_INCLUDE_DIRS}/..") SET(CMAKE_REQUIRED_INCLUDES "${Thrift_INCLUDE_DIRS}/..")
CHECK_CXX_SOURCE_COMPILES( CHECK_CXX_SOURCE_COMPILES(
" "
#include <thrift/Thrift.h> #include <thrift/Thrift.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -37,9 +33,9 @@ int main() { ...@@ -37,9 +33,9 @@ int main() {
return 0; return 0;
} }
" CASSANDRASE_OK) " CASSANDRASE_OK)
ENDIF()
IF(CASSANDRASE_OK) SET(cassandra_sources
SET(cassandra_sources
ha_cassandra.cc ha_cassandra.cc
ha_cassandra.h ha_cassandra.h
cassandra_se.h cassandra_se.h
...@@ -51,10 +47,11 @@ IF(CASSANDRASE_OK) ...@@ -51,10 +47,11 @@ IF(CASSANDRASE_OK)
gen-cpp/cassandra_constants.cpp gen-cpp/cassandra_constants.cpp
gen-cpp/Cassandra.h) gen-cpp/Cassandra.h)
LINK_DIRECTORIES(${LINK_DIR}) LINK_DIRECTORIES(${LINK_DIR})
SET(CASSANDRA_DEB_FILES "usr/lib/mysql/plugin/ha_cassandra.so" PARENT_SCOPE) SET(CASSANDRA_DEB_FILES "usr/lib/mysql/plugin/ha_cassandra.so" PARENT_SCOPE)
MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift COMPONENT cassandra-engine) MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE
ONLY_IF CASSANDRASE_OK
MODULE_ONLY LINK_LIBRARIES thrift COMPONENT cassandra-engine)
ENDIF(CASSANDRASE_OK)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
FUNCTION(CHECK_OQGRAPH)
MESSAGE(STATUS "Configuring OQGraph") MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost) FIND_PACKAGE(Boost)
IF(NOT Boost_FOUND) IF(NOT Boost_FOUND)
...@@ -37,26 +38,29 @@ ENDIF() ...@@ -37,26 +38,29 @@ ENDIF()
IF(BOOST_OK) IF(BOOST_OK)
ADD_DEFINITIONS(-DHAVE_OQGRAPH) ADD_DEFINITIONS(-DHAVE_OQGRAPH)
IF(MSVC) IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" PARENT_SCOPE)
# Fix problem with judy not finding inttypes.h on Windows: # Fix problem with judy not finding inttypes.h on Windows:
ADD_DEFINITIONS(-DJU_WIN) ADD_DEFINITIONS(-DJU_WIN)
ELSE(MSVC) ELSE(MSVC)
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive")
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive" PARENT_SCOPE)
ENDIF(MSVC) ENDIF(MSVC)
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1) ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
MESSAGE(STATUS "OQGraph OK")
ELSE(BOOST_OK)
MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled")
ENDIF(BOOST_OK)
ENDFUNCTION()
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc CHECK_OQGRAPH()
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
STORAGE_ENGINE STORAGE_ENGINE
ONLY_IF BOOST_OK
MODULE_ONLY MODULE_ONLY
RECOMPILE_FOR_EMBEDDED RECOMPILE_FOR_EMBEDDED
COMPONENT oqgraph-engine COMPONENT oqgraph-engine
LINK_LIBRARIES ${Judy_LIBRARIES}) LINK_LIBRARIES ${Judy_LIBRARIES})
MESSAGE(STATUS "OQGraph OK")
ELSE(BOOST_OK)
MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled")
ENDIF(BOOST_OK)
...@@ -10,6 +10,7 @@ int main() { return 0; } ...@@ -10,6 +10,7 @@ int main() { return 0; }
ENDIF() ENDIF()
IF(NOT TOKUDB_OK OR WITHOUT_TOKUDB OR WITHOUT_TOKUDB_STORAGE_ENGINE) IF(NOT TOKUDB_OK OR WITHOUT_TOKUDB OR WITHOUT_TOKUDB_STORAGE_ENGINE)
MYSQL_ADD_PLUGIN(tokudb DISABLED)
RETURN() RETURN()
ENDIF() ENDIF()
......
...@@ -403,17 +403,12 @@ SET(INNOBASE_SOURCES ...@@ -403,17 +403,12 @@ SET(INNOBASE_SOURCES
ut/ut0vec.cc ut/ut0vec.cc
ut/ut0wqueue.cc) ut/ut0wqueue.cc)
IF(WITH_INNODB) IF(NOT XTRADB_OK)
# Legacy option MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF() ENDIF()
IF(XTRADB_OK) MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE DEFAULT ONLY_IF XTRADB_OK
DEFAULT
RECOMPILE_FOR_EMBEDDED RECOMPILE_FOR_EMBEDDED
LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT}) LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
ELSE()
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
ENDIF()
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