Allow overriding NUM_THREADS

This commit is contained in:
Isuru Fernando 2017-12-01 01:39:46 -06:00
parent cc26cdce0c
commit e0ddd7d124
1 changed files with 6 additions and 5 deletions

View File

@ -94,14 +94,15 @@ if (NOT CMAKE_CROSSCOMPILING)
ProcessorCount(NUM_CORES)
endif()
if (NOT NUM_CORES EQUAL 0)
# HT?
set(NUM_THREADS ${NUM_CORES})
endif ()
endif()
if (NOT DEFINED NUM_THREADS)
set(NUM_THREADS 0)
if (NOT NUM_CORES EQUAL 0)
# HT?
set(NUM_THREADS ${NUM_CORES})
else ()
set(NUM_THREADS 0)
endif ()
endif()
if (${NUM_THREADS} LESS 2)