Skip to content

Commit

Permalink
#1173: disable threading by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Jan 20, 2021
1 parent 663ce72 commit a0f3c88
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions cmake/load_threading_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ include(cmake/threading_config.cmake)
option(USE_STD_THREAD "whether to force use of std::thread for threading" OFF)
option(USE_OPENMP "whether to force use of OpenMP for threading" OFF)

find_package(OpenMP)

# OpenMP support
if (USE_STD_THREAD)
message("Using std::thread for worker threading")
message(
STATUS
"Using std::thread for worker threading"
)
config_for_std_thread()
elseif(USE_OPENMP)
message(
STATUS
"Using OpenMP for worker threading"
)
find_package(OpenMP)
config_for_openmp()
if (NOT OpenMP_FOUND)
message(
Expand All @@ -24,9 +29,9 @@ elseif(USE_OPENMP)
"valid OpenMP in compiler"
)
endif()
elseif(OpenMP_FOUND) #no default specified
config_for_openmp()
else() #no default specified
message("OpenMP not found: using std::thread for workers")
config_for_std_thread()
else()
message(
STATUS
"No threading configuration provided"
)
endif()

0 comments on commit a0f3c88

Please sign in to comment.