From be9385ef06f6d93de2957fa3f2513e60622f6ff0 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 17 Jan 2022 07:12:43 +0100 Subject: [PATCH] cmake: use at least 1 core to build SITL If we use -j 0, ninja fails with invalid argument. --- platforms/posix/cmake/sitl_target.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platforms/posix/cmake/sitl_target.cmake b/platforms/posix/cmake/sitl_target.cmake index ffae877cb0..1aedf5b051 100644 --- a/platforms/posix/cmake/sitl_target.cmake +++ b/platforms/posix/cmake/sitl_target.cmake @@ -49,6 +49,10 @@ if(parallel_jobs GREATER NUMBER_OF_LOGICAL_CORES) set(parallel_jobs ${NUMBER_OF_LOGICAL_CORES}) endif() +if(parallel_jobs LESS 1) + set(parallel_jobs 1) +endif() + message(DEBUG "${NUMBER_OF_LOGICAL_CORES} logical cores detected and ${AVAILABLE_PHYSICAL_MEMORY} megabytes of memory available. Limiting sitl_gazebo and simulation-ignition concurrent jobs to ${parallel_jobs}")