mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Don't allow ninja job pool sizes to be negative
If the job pool size becomes negative, ninja treats it as an absurdly large positive integer and errors out.
This commit is contained in:
parent
8c96769e81
commit
53158aa2ea
@ -123,13 +123,15 @@ function(vtkm_setup_job_pool)
|
||||
# compilation units to be built at the same time.
|
||||
#
|
||||
# We try to allocate a pool size where we presume each compilation process
|
||||
# will require 4GB of memory. To allow for other NON VTK-m jobs we leave at
|
||||
# least 8GB of memory as 'slop'.
|
||||
# will require 3GB of memory. To allow for other NON VTK-m jobs we leave at
|
||||
# least 3GB of memory as 'slop'.
|
||||
cmake_host_system_information(RESULT vtkm_mem_ QUERY TOTAL_PHYSICAL_MEMORY)
|
||||
math(EXPR vtkm_pool_size "(${vtkm_mem_}/4096)-2")
|
||||
if (vtkm_pool_size EQUAL 0)
|
||||
math(EXPR vtkm_pool_size "(${vtkm_mem_}/3072)-1")
|
||||
|
||||
if (vtkm_pool_size LESS 1)
|
||||
set(vtkm_pool_size 1)
|
||||
endif ()
|
||||
|
||||
set_property(GLOBAL APPEND
|
||||
PROPERTY
|
||||
JOB_POOLS vtkm_pool=${vtkm_pool_size})
|
||||
|
Loading…
Reference in New Issue
Block a user