From 1c979889b2b6fa81495e7a1fbc22f56faaac1ab2 Mon Sep 17 00:00:00 2001 From: demostanis Date: Fri, 2 Sep 2022 10:52:15 +0200 Subject: [PATCH] Meta: Print error if cmake does not exist --- Meta/CMake/processor-count.cmake | 4 +++- Meta/serenity.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Meta/CMake/processor-count.cmake b/Meta/CMake/processor-count.cmake index d77786de4c2..f0bf79f929a 100644 --- a/Meta/CMake/processor-count.cmake +++ b/Meta/CMake/processor-count.cmake @@ -1,3 +1,5 @@ include(ProcessorCount) ProcessorCount(N) -message("${N}") +# Executing echo here allows us to print to the standard output, +# to separate the processor count from potential errors +execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "${N}") diff --git a/Meta/serenity.sh b/Meta/serenity.sh index 1d0e5f356ad..50a5f8efb77 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -262,7 +262,7 @@ build_target() { fi # Get either the environment MAKEJOBS or all processors via CMake - [ -z "$MAKEJOBS" ] && MAKEJOBS=$(cmake -P "$SERENITY_SOURCE_DIR/Meta/CMake/processor-count.cmake" 2>&1) + [ -z "$MAKEJOBS" ] && MAKEJOBS=$(cmake -P "$SERENITY_SOURCE_DIR/Meta/CMake/processor-count.cmake") # With zero args, we are doing a standard "build" # With multiple args, we are doing an install/image/run