From e0ddd7d12411320c16026e741863ccdea8df3b52 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 1 Dec 2017 01:39:46 -0600 Subject: [PATCH] Allow overriding NUM_THREADS --- cmake/system.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/system.cmake b/cmake/system.cmake index 236a7e8889..064e7e4f28 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -94,16 +94,17 @@ if (NOT CMAKE_CROSSCOMPILING) ProcessorCount(NUM_CORES) endif() +endif() + +if (NOT DEFINED NUM_THREADS) if (NOT NUM_CORES EQUAL 0) # HT? set(NUM_THREADS ${NUM_CORES}) + else () + set(NUM_THREADS 0) endif () endif() -if (NOT DEFINED NUM_THREADS) - set(NUM_THREADS 0) -endif() - if (${NUM_THREADS} LESS 2) set(USE_THREAD 0) elseif(NOT DEFINED USE_THREAD)