Browse Source

Merge pull request #1377 from isuruf/threads

Allow overriding NUM_THREADS in cmake
tags/v0.3.0
Martin Kroeker GitHub 8 years ago
parent
commit
0dc291d3fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      cmake/system.cmake

+ 5
- 4
cmake/system.cmake View File

@@ -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)


Loading…
Cancel
Save