From b53df8cfb08244401e55d24b29bbb32292bfe278 Mon Sep 17 00:00:00 2001 From: no92 Date: Wed, 12 Jun 2024 17:35:07 +0200 Subject: [PATCH] meta: prevent linux_kernel_headers from being set to `/usr/include` --- meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index bb8928f30b..9c1686f38d 100644 --- a/meson.build +++ b/meson.build @@ -201,6 +201,10 @@ if host_machine.system() == 'linux' error('linux_kernel_headers is not set') endif + if fs.is_samepath(get_option('linux_kernel_headers'), '/usr/include') + error('linux_kernel_headers must be set to a Linux kernel header install directory, not your /usr/include') + endif + if not import('fs').is_dir(get_option('linux_kernel_headers')) error('linux_kernel_headers is not set to a valid path') endif @@ -299,6 +303,10 @@ if not disable_linux_option error('linux_kernel_headers is not set') endif + if fs.is_samepath(get_option('linux_kernel_headers'), '/usr/include') + error('linux_kernel_headers must be set to a Linux kernel header install directory, not your /usr/include') + endif + if not import('fs').is_dir(get_option('linux_kernel_headers')) error('linux_kernel_headers is not set to a valid path') endif