2014-08-06 14:39:15 +02:00
|
|
|
# Copyright (c) 2011, Codership Oy <info@codership.com>.
|
|
|
|
# Copyright (c) 2013, Monty Program Ab.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2019-05-11 21:19:05 +02:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
|
2014-08-06 14:39:15 +02:00
|
|
|
|
2014-09-25 23:00:45 +02:00
|
|
|
#
|
|
|
|
# Galera library does not compile with windows
|
|
|
|
#
|
2024-06-07 08:56:17 +02:00
|
|
|
IF(WITHOUT_SERVER)
|
|
|
|
OPTION(WITH_WSREP "Galera server compatibility in build client utilities" ON)
|
|
|
|
ELSE()
|
2014-09-25 23:00:45 +02:00
|
|
|
IF(UNIX)
|
|
|
|
SET(with_wsrep_default ON)
|
|
|
|
ELSE()
|
|
|
|
SET(with_wsrep_default OFF)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
|
2019-01-23 12:30:00 +01:00
|
|
|
OPTION(WITH_WSREP_ALL
|
|
|
|
"Build all components of WSREP (unit tests, sample programs)"
|
|
|
|
OFF)
|
2014-09-25 23:00:45 +02:00
|
|
|
|
2019-02-12 05:59:05 +01:00
|
|
|
IF(WITH_WSREP)
|
|
|
|
# Set the patch version
|
|
|
|
SET(WSREP_PATCH_VERSION "22")
|
2014-08-06 14:39:15 +02:00
|
|
|
|
2019-02-13 01:31:55 +01:00
|
|
|
IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/wsrep-lib/wsrep-API/v26/wsrep_api.h")
|
|
|
|
MESSAGE(FATAL_ERROR "No MariaDB wsrep-API code! Run
|
|
|
|
${GIT_EXECUTABLE} submodule update --init --recursive
|
|
|
|
Then restart the build.
|
|
|
|
")
|
|
|
|
ENDIF()
|
2019-02-12 05:59:05 +01:00
|
|
|
# Obtain wsrep API version
|
|
|
|
FILE(STRINGS "${CMAKE_SOURCE_DIR}/wsrep-lib/wsrep-API/v26/wsrep_api.h" WSREP_API_VERSION
|
|
|
|
LIMIT_COUNT 1 REGEX "WSREP_INTERFACE_VERSION")
|
|
|
|
STRING(REGEX MATCH "([0-9]+)" WSREP_API_VERSION "${WSREP_API_VERSION}")
|
2014-08-06 14:39:15 +02:00
|
|
|
|
2019-02-12 05:59:05 +01:00
|
|
|
SET(WSREP_VERSION "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
|
|
|
|
CACHE INTERNAL "WSREP version")
|
2014-08-06 14:39:15 +02:00
|
|
|
|
2019-02-12 05:59:05 +01:00
|
|
|
SET(WSREP_PROC_INFO ${WITH_WSREP})
|
2014-08-06 14:39:15 +02:00
|
|
|
|
2015-05-29 17:26:46 +02:00
|
|
|
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
|
2019-01-23 12:30:00 +01:00
|
|
|
if (NOT WITH_WSREP_ALL)
|
|
|
|
SET(WSREP_LIB_WITH_UNIT_TESTS OFF CACHE BOOL
|
|
|
|
"Disable unit tests for wsrep-lib")
|
|
|
|
SET(WSREP_LIB_WITH_DBSIM OFF CACHE BOOL
|
|
|
|
"Disable building dbsim for wsrep-lib")
|
|
|
|
endif()
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep-lib/include)
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/wsrep-lib/wsrep-API/v26)
|
2019-08-02 17:57:49 +02:00
|
|
|
|
|
|
|
SET(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
|
|
|
|
SET(BUILD_SHARED_LIBS OFF)
|
|
|
|
ADD_SUBDIRECTORY(wsrep-lib)
|
|
|
|
SET(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
|
2014-09-25 23:00:45 +02:00
|
|
|
ENDIF()
|
2017-08-09 21:39:18 +02:00
|
|
|
IF (NOT WIN32)
|
|
|
|
ADD_FEATURE_INFO(WSREP WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)")
|
|
|
|
ENDIF()
|
2024-06-29 01:48:38 +02:00
|
|
|
ENDIF(WITHOUT_SERVER)
|