From 9295c4557aa0cd3b6bece7e0d3d286e4110711cb Mon Sep 17 00:00:00 2001 From: blenderfreaky Date: Tue, 5 Aug 2025 06:08:19 +0200 Subject: [PATCH] Workaround build failure when building for jemalloc with ninja (#1474) --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e0eac132..cfec20fa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,7 +214,14 @@ else() DEPENDS ${jemalloc_targ_SOURCE_DIR}/configure) if(NOT UMF_QEMU_BUILD) - set(MAKE_ARGUMENTS "-j$(nproc)") + if(CMAKE_GENERATOR STREQUAL "Ninja") + # While CMake is supposed to escape this in the generated build + # files, for some reason, it doesn't do so here. Until it's fixed, + # we just manually escape it for ninja. + set(MAKE_ARGUMENTS "-j$$(nproc)") + else() + set(MAKE_ARGUMENTS "-j$(nproc)") + endif() endif() add_custom_command(