Skip to content

Commit

Permalink
Disable OpenMP.
Browse files Browse the repository at this point in the history
This is unfortunate, but OpenMP is not available on some toolchains
(most MinGW builds) and, more importantly, breaks the distribution
model we use on Windows, which is a single self-contained executable.

Leave the OpenMP disabled by default everywhere so that we don't have
any second-class platforms where SolveSpace is slower than on first-
class ones.

Fixes #631.
  • Loading branch information
whitequark committed Jun 21, 2020
1 parent 0da4a6b commit e0eb235
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "X8
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLOAT_FLAGS}")
endif()

# We use OpenMP to speed up some geometric operations, but it's optional.
include(FindOpenMP)
# No MinGW distribution actually ships an OpenMP runtime, but FindOpenMP detects it anyway.
if(OpenMP_FOUND AND NOT MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(WARNING "OpenMP not found, geometric operations will be single-threaded")
if(ENABLE_OPENMP)
include(FindOpenMP)
if(OpenMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()

if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
Expand Down

0 comments on commit e0eb235

Please sign in to comment.