summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOtto Kekäläinen <otto@kekalainen.net>2021-05-30 15:42:04 -0700
committerSergei Golubchik <serg@mariadb.org>2021-06-10 12:47:01 +0200
commit152c83d49ca821c54aa49f6b43e33cba63e4d19f (patch)
tree7ce3b7a52368b559cb34c96b9729c186204a51b7 /cmake
parent396864c6b3d2cca9962f7eb58964f50ed6b612dc (diff)
downloadmariadb-git-152c83d49ca821c54aa49f6b43e33cba63e4d19f.tar.gz
MDEV-20392: Skip ABI check if 'diff' is not found
Not all environments have 'diff' installed. Most notably CentOS 8 does not have diff out-of-the-box. Thus users running 'cmake .' and 'make' would fail to build MariaDB, and they would think the error was in ABI incompatibilities due to the error message emitted by CMake when in reality simply 'diff' was missing. This fixes it and makes the developer experience better by simply skipping the diffing if 'diff' is not found. Closes #1846
Diffstat (limited to 'cmake')
-rw-r--r--cmake/do_abi_check.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake
index 43d8b15a7ab..0ad0fa39670 100644
--- a/cmake/do_abi_check.cmake
+++ b/cmake/do_abi_check.cmake
@@ -74,7 +74,9 @@ FOREACH(file ${ABI_HEADERS})
FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
- IF(NOT ${result} EQUAL 0)
+ IF(result MATCHES "No such file or directory")
+ MESSAGE("Command 'diff' not found. ABI check for ${file} skipped.")
+ ELSEIF(NOT result EQUAL 0)
IF(ABI_UPDATE)
EXECUTE_PROCESS(COMMAND mv -v ${abi_check_out} ${file}.pp)
ELSE(ABI_UPDATE)
@@ -84,4 +86,3 @@ FOREACH(file ${ABI_HEADERS})
ENDIF()
FILE(REMOVE ${abi_check_out})
ENDFOREACH()
-