Skip to content

Commit e0ddd7d

Browse files
committed
Allow overriding NUM_THREADS
1 parent cc26cdc commit e0ddd7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmake/system.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,17 @@ if (NOT CMAKE_CROSSCOMPILING)
9494
ProcessorCount(NUM_CORES)
9595
endif()
9696

97+
endif()
98+
99+
if (NOT DEFINED NUM_THREADS)
97100
if (NOT NUM_CORES EQUAL 0)
98101
# HT?
99102
set(NUM_THREADS ${NUM_CORES})
103+
else ()
104+
set(NUM_THREADS 0)
100105
endif ()
101106
endif()
102107

103-
if (NOT DEFINED NUM_THREADS)
104-
set(NUM_THREADS 0)
105-
endif()
106-
107108
if (${NUM_THREADS} LESS 2)
108109
set(USE_THREAD 0)
109110
elseif(NOT DEFINED USE_THREAD)

0 commit comments

Comments
 (0)