From 63d15f7dfc447e431a22285126ab822461c9337e Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 27 Feb 2019 17:22:02 +0900 Subject: [PATCH] CMake Kbuild: fail at cmake time if KERNEL_DIR is missing Change-Id: I66660718841d05003b87995d68bec728aa0db9ba --- cmake/modules/Kbuild.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/modules/Kbuild.cmake b/cmake/modules/Kbuild.cmake index cec3344a..bcc6b98f 100644 --- a/cmake/modules/Kbuild.cmake +++ b/cmake/modules/Kbuild.cmake @@ -78,6 +78,10 @@ endif(ENABLE_WERROR) # the native build system do these checks, if possible at all... add_custom_command(OUTPUT kmod_always_rebuild COMMAND touch kmod_always_rebuild) + if (NOT EXISTS "${KERNEL_DIR}/Makefile") + message(FATAL_ERROR "${KERNEL_DIR} does not contain a Makefile and is probably missing. install kernel development package or set the KERNEL_DIR variable") + endif() + add_custom_command( OUTPUT "${MODULE_NAME}.ko" "Module.symvers"