Merge pull request #1377 from isuruf/threads

Allow overriding NUM_THREADS in cmake
This commit is contained in:
Martin Kroeker 2017-12-01 16:22:35 +01:00 committed by GitHub
commit 0dc291d3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)