Check PARALLEL_LEVEL maximum

This commit is contained in:
Allen Byrne 2018-11-19 10:02:40 -06:00
parent e9125d6a99
commit a26aedce04

View File

@ -158,7 +158,12 @@ endif ()
# Use multiple CPU cores to build
include (ProcessorCount)
ProcessorCount (N)
if (NOT N EQUAL 0)
if (NOT N EQUAL 0)
if (MAX_PROC_COUNT)
if (N GREATER MAX_PROC_COUNT)
set (N ${MAX_PROC_COUNT)
endif ()
endif ()
if (NOT WIN32)
set (CTEST_BUILD_FLAGS -j${N})
endif ()