diff options
| author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-07-25 15:18:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-25 06:18:49 -0700 |
| commit | e12035fc0ce2f94015e665e410d09f58647078ed (patch) | |
| tree | dde9894e99c4f4bd2d9280169ea98443aa895366 /cmake | |
| parent | e12c62c1f7a7ebb957831ca1e0e49771e190a1a8 (diff) | |
| download | rneovim-e12035fc0ce2f94015e665e410d09f58647078ed.tar.gz rneovim-e12035fc0ce2f94015e665e410d09f58647078ed.tar.bz2 rneovim-e12035fc0ce2f94015e665e410d09f58647078ed.zip | |
build(lint): check uncrustify version #19468
This to prevent the user from accidentally using the wrong uncrustify
version.
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/CheckUncrustifyVersion.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/CheckUncrustifyVersion.cmake b/cmake/CheckUncrustifyVersion.cmake new file mode 100644 index 0000000000..4812c24ace --- /dev/null +++ b/cmake/CheckUncrustifyVersion.cmake @@ -0,0 +1,13 @@ +if(UNCRUSTIFY_PRG) + execute_process(COMMAND uncrustify --version + OUTPUT_VARIABLE user_version + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version}) + + file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1) + string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version}) + + if(NOT user_version STREQUAL required_version) + message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}") + endif() +endif() |