[Buildroot] [git commit] package/pkg-cmake: fix late expansion in infra

Yann E. MORIN yann.morin.1998 at free.fr
Thu Sep 7 14:51:37 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=a0c0bc9d33eb1a3b481e30021d31d20e257b337d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Commit 4cf79d9b71ff (pkg-cmake: add option to select the Ninja
generator) forgot to account for the late expansion rule in the inner
infrastructure macros, which breaks the build in two ways:

 1. the expansion of $(firstword $$(MAKE)) does not actually expands to
    the first word, but to the full value of $(MAKE);

 2. the paths are invalid for per-package directories.

Fix that by applying the proper double-dollar rule for inner macros.

Reported-by: Thomas Devoogdt <thomas.devoogdt at barco.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
 package/pkg-cmake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index e085fb2b5d..8f391eb4c9 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -65,7 +65,7 @@ endif
 ifeq ($$($(3)_CMAKE_BACKEND),make)
 $(2)_GENERATOR = "Unix Makefiles"
 # $$(MAKE) can be 'make -jN', we just want 'make'  (possibly with a full path)
-$(2)_GENERATOR_PROGRAM = $(firstword $$(MAKE))
+$(2)_GENERATOR_PROGRAM = $$(firstword $$(MAKE))
 # Generator specific code (make) should be avoided,
 # but for now, copy them to the new variables.
 $(2)_BUILD_ENV ?= $$($(2)_MAKE_ENV)
@@ -74,7 +74,7 @@ $(2)_BUILD_OPTS ?= -- $$($(2)_MAKE_OPTS)
 else ifeq ($$($(3)_CMAKE_BACKEND),ninja)
 $(2)_DEPENDENCIES += host-ninja
 $(2)_GENERATOR = "Ninja"
-$(2)_GENERATOR_PROGRAM = $(HOST_DIR)/bin/ninja
+$(2)_GENERATOR_PROGRAM = $$(HOST_DIR)/bin/ninja
 
 else
 $$(error Unsupported cmake backend "$$($(3)_CMAKE_BACKEND)")



More information about the buildroot mailing list