From b69fc85e6608afc2f62111e254416eaeb6fe0aab Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Wed, 4 Feb 2026 19:35:24 +0100 Subject: [PATCH] support/misc/Buildroot-Initialize.cmake: make include optional Buildroot commit [1] introduced a new Buildroot-Initialize.cmake file, to mimic the upstream Linux-Initialize.cmake. However, this upstream file was introduced in commit [2], which was introduced in CMake 3.27. When compiling a cmake package on a host with a cmake older than version 3.27 (for example, the Buildroot Docker reference image has cmake 3.25), the configuration fails with the error: CMake Error at /buildroot/output/host/share/buildroot/Platform/Buildroot-Initialize.cmake:1 (include): include could not find requested file: Platform/Linux-Initialize Call Stack (most recent call first): /usr/share/cmake-3.25/Modules/CMakeSystemSpecificInitialize.cmake:21 (include) CMakeLists.txt:20 (project) CMake version < 3.27 is setting its LINUX predefine elsewhere (see commit log of [1]), so this commit fixes the issue by simply making the include optional. This will guarante thee cmake predefines will be present in all the cases. Fixes: [1] [1] https://gitlab.com/buildroot.org/buildroot/-/commit/ef9f0a07ed40970a7de4c608a5708ef6ceb75131 [2] https://gitlab.kitware.com/cmake/cmake/-/commit/cc737ae8295156812e697a9d2f3f7b79bf7b72c8 Signed-off-by: Julien Olivain Signed-off-by: Peter Korsgaard --- support/misc/Buildroot-Initialize.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/misc/Buildroot-Initialize.cmake b/support/misc/Buildroot-Initialize.cmake index 3451562f08..3ee54f349b 100644 --- a/support/misc/Buildroot-Initialize.cmake +++ b/support/misc/Buildroot-Initialize.cmake @@ -1 +1 @@ -include(Platform/Linux-Initialize) +include(Platform/Linux-Initialize OPTIONAL)