summaryrefslogtreecommitdiff
path: root/cmake/wsrep.cmake
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2019-02-13 11:31:55 +1100
committerDaniel Black <daniel@linux.ibm.com>2019-02-13 11:36:03 +1100
commit4f5c65367afaa1a633a0fee8754f24a944c681b5 (patch)
treef0d9a35fc9da994227a1bfa5bd71f2481df3f452 /cmake/wsrep.cmake
parent4d5f85a3ec59b4a417da39a229fbb58e79c32029 (diff)
downloadmariadb-git-4f5c65367afaa1a633a0fee8754f24a944c681b5.tar.gz
cmake-wsrep: friendly error message about missing wsrep_api.h
Without this commit the error message is: $ cmake . -DWITH_WSREP=ON -- Running cmake version 3.12.1 -- MariaDB 10.4.3 CMake Error at cmake/wsrep.cmake:36 (FILE): FILE STRINGS file ".../mariadb-server-10.4/wsrep-lib/wsrep-API/v26/wsrep_api.h" cannot be read. Call Stack (most recent call first): CMakeLists.txt:147 (INCLUDE) Having 'git config cmake.update-submodules yes' nicely updates the build without error. $ cmake . -DWITH_WSREP=ON -- Running cmake version 3.12.1 -- MariaDB 10.4.3 Submodule path 'wsrep-lib': checked out 'e7d72ae7f6a6995a21d743389426a963429a1fff' Submodule path 'wsrep-lib/wsrep-API/v26': checked out '75a5f452f2ba07b0f4a3a9a94825fccc71b27398'
Diffstat (limited to 'cmake/wsrep.cmake')
-rw-r--r--cmake/wsrep.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake
index 37ed0c78cf5..603f1955e5f 100644
--- a/cmake/wsrep.cmake
+++ b/cmake/wsrep.cmake
@@ -32,6 +32,12 @@ IF(WITH_WSREP)
# Set the patch version
SET(WSREP_PATCH_VERSION "22")
+ 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()
# 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")