summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-06-23 12:09:00 +0200
committerSergei Golubchik <serg@mariadb.org>2014-06-23 17:39:13 +0200
commit787ec317784d58ca00c0c8e772173c66c5145f50 (patch)
tree3c46c110880a481341ba0cd40d54ce3af7ddea3d /storage
parentda9bb66b028da9ef716de7325a5a91fa6216c217 (diff)
downloadmariadb-git-787ec317784d58ca00c0c8e772173c66c5145f50.tar.gz
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.
Diffstat (limited to 'storage')
-rw-r--r--storage/cassandra/CMakeLists.txt49
-rw-r--r--storage/oqgraph/CMakeLists.txt26
-rw-r--r--storage/tokudb/CMakeLists.txt1
-rw-r--r--storage/xtradb/CMakeLists.txt17
4 files changed, 45 insertions, 48 deletions
diff --git a/storage/cassandra/CMakeLists.txt b/storage/cassandra/CMakeLists.txt
index aab85f254f8..e47e654d18e 100644
--- a/storage/cassandra/CMakeLists.txt
+++ b/storage/cassandra/CMakeLists.txt
@@ -17,18 +17,14 @@ MARK_AS_ADVANCED(Thrift_LIBS Thrift_INCLUDE_DIRS)
IF(EXISTS ${Thrift_LIBS})
GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE)
-ELSE()
- RETURN()
-ENDIF()
-
-INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS}/..)
-SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
+ 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-implicit-templates" "" 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}")
-SET(CMAKE_REQUIRED_INCLUDES "${Thrift_INCLUDE_DIRS}/..")
-CHECK_CXX_SOURCE_COMPILES(
+ SET(CMAKE_REQUIRED_INCLUDES "${Thrift_INCLUDE_DIRS}/..")
+ CHECK_CXX_SOURCE_COMPILES(
"
#include <thrift/Thrift.h>
#include <boost/shared_ptr.hpp>
@@ -37,24 +33,25 @@ int main() {
return 0;
}
" CASSANDRASE_OK)
+ENDIF()
-IF(CASSANDRASE_OK)
- SET(cassandra_sources
- ha_cassandra.cc
- ha_cassandra.h
- cassandra_se.h
- cassandra_se.cc
- gen-cpp/Cassandra.cpp
- gen-cpp/cassandra_types.h
- gen-cpp/cassandra_types.cpp
- gen-cpp/cassandra_constants.h
- gen-cpp/cassandra_constants.cpp
- gen-cpp/Cassandra.h)
+SET(cassandra_sources
+ ha_cassandra.cc
+ ha_cassandra.h
+ cassandra_se.h
+ cassandra_se.cc
+ gen-cpp/Cassandra.cpp
+ gen-cpp/cassandra_types.h
+ gen-cpp/cassandra_types.cpp
+ gen-cpp/cassandra_constants.h
+ gen-cpp/cassandra_constants.cpp
+ 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)
diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt
index 151082469a9..7e10081a08a 100644
--- a/storage/oqgraph/CMakeLists.txt
+++ b/storage/oqgraph/CMakeLists.txt
@@ -1,9 +1,10 @@
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+FUNCTION(CHECK_OQGRAPH)
MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost)
IF(NOT Boost_FOUND)
- MESSAGE(STATUS "Boost not found. OQGraph will not be compiled")
+ MESSAGE(STATUS "Boost not found. OQGraph will not be compiled")
RETURN()
ENDIF()
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
@@ -37,26 +38,29 @@ ENDIF()
IF(BOOST_OK)
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
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:
ADD_DEFINITIONS(-DJU_WIN)
ELSE(MSVC)
# 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-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)
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
-
- MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
- oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
- STORAGE_ENGINE
- MODULE_ONLY
- RECOMPILE_FOR_EMBEDDED
- COMPONENT oqgraph-engine
- 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)
+ENDFUNCTION()
+
+CHECK_OQGRAPH()
+MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
+ oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
+ STORAGE_ENGINE
+ ONLY_IF BOOST_OK
+ MODULE_ONLY
+ RECOMPILE_FOR_EMBEDDED
+ COMPONENT oqgraph-engine
+ LINK_LIBRARIES ${Judy_LIBRARIES})
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index b5993f85656..7dcf96a2ac2 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -10,6 +10,7 @@ int main() { return 0; }
ENDIF()
IF(NOT TOKUDB_OK OR WITHOUT_TOKUDB OR WITHOUT_TOKUDB_STORAGE_ENGINE)
+ MYSQL_ADD_PLUGIN(tokudb DISABLED)
RETURN()
ENDIF()
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index fc5c1567987..bb1749279d0 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -403,17 +403,12 @@ SET(INNOBASE_SOURCES
ut/ut0vec.cc
ut/ut0wqueue.cc)
-IF(WITH_INNODB)
- # Legacy option
- SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
-ENDIF()
-
-IF(XTRADB_OK)
- MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
- DEFAULT
- RECOMPILE_FOR_EMBEDDED
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
-ELSE()
+IF(NOT XTRADB_OK)
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
ENDIF()
+MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
+ DEFAULT ONLY_IF XTRADB_OK
+ RECOMPILE_FOR_EMBEDDED
+ LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
+