Skip to content

Commit f81815e

Browse files
authored
Fix CMake cross-compiling
Without specifying thread count, NUM_THREADS would not be defined and CMake would fail. This is because core count cannot be determined when cross-compiling.
1 parent 5f855d9 commit f81815e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/system.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if (NOT CMAKE_CROSSCOMPILING)
9797
endif()
9898

9999
if (NOT DEFINED NUM_THREADS)
100-
if (NOT NUM_CORES EQUAL 0)
100+
if (DEFINED NUM_CORES AND NOT NUM_CORES EQUAL 0)
101101
# HT?
102102
set(NUM_THREADS ${NUM_CORES})
103103
else ()

0 commit comments

Comments
 (0)