From a0c0bc9d33eb1a3b481e30021d31d20e257b337d Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 7 Aug 2023 19:37:32 +0200 Subject: [PATCH] package/pkg-cmake: fix late expansion in infra 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 Signed-off-by: Yann E. MORIN --- 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)")