From 1e9597534a109e3dbce730287c5b45e1b6782c93 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 Oct 2021 14:51:09 +0200 Subject: [BUILD] CheckPatch: Quote variable to avoid error if empty The variable is most likely empty if the according kernel headers directory was deleted. However, as it currently stands, cmake is complaining about too few arguments, which isn't really helpful to the user. Instead, quote the variable to make cmake finish, and have the actual compile process of the kernel module fail, which will yield a much more helpful error message. --- cmake/FindCheckPatch.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindCheckPatch.cmake b/cmake/FindCheckPatch.cmake index 2772676..3fa1ec8 100644 --- a/cmake/FindCheckPatch.cmake +++ b/cmake/FindCheckPatch.cmake @@ -20,7 +20,7 @@ if(CheckPatch_EXECUTABLE) execute_process(COMMAND ${CheckPatch_EXECUTABLE} --version OUTPUT_VARIABLE CheckPatch_VERBOSE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE ".*Version:.([0-9]+\\.[0-9]+).*" "\\1" CheckPatch_VERSION ${CheckPatch_VERBOSE_VERSION}) + string(REGEX REPLACE ".*Version:.([0-9]+\\.[0-9]+).*" "\\1" CheckPatch_VERSION "${CheckPatch_VERBOSE_VERSION}") endif(CheckPatch_EXECUTABLE) include(FindPackageHandleStandardArgs) -- cgit v1.2.3-55-g7522