Disable OpenMP.
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.pull/640/head
parent
0da4a6b78a
commit
a80a0337a5
|
@ -46,6 +46,8 @@ set(ENABLE_COVERAGE OFF CACHE BOOL
|
||||||
"Whether code coverage information will be collected")
|
"Whether code coverage information will be collected")
|
||||||
set(ENABLE_SANITIZERS OFF CACHE BOOL
|
set(ENABLE_SANITIZERS OFF CACHE BOOL
|
||||||
"Whether to enable Clang's AddressSanitizer and UndefinedBehaviorSanitizer")
|
"Whether to enable Clang's AddressSanitizer and UndefinedBehaviorSanitizer")
|
||||||
|
set(ENABLE_OPENMP OFF CACHE BOOL
|
||||||
|
"Whether geometric operations will be parallelized using OpenMP")
|
||||||
|
|
||||||
set(OPENGL 3 CACHE STRING "OpenGL version to use (one of: 1 3)")
|
set(OPENGL 3 CACHE STRING "OpenGL version to use (one of: 1 3)")
|
||||||
|
|
||||||
|
@ -96,13 +98,11 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "X8
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLOAT_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLOAT_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# We use OpenMP to speed up some geometric operations, but it's optional.
|
if(ENABLE_OPENMP)
|
||||||
include(FindOpenMP)
|
include(FindOpenMP)
|
||||||
# No MinGW distribution actually ships an OpenMP runtime, but FindOpenMP detects it anyway.
|
if(OpenMP_FOUND)
|
||||||
if(OpenMP_FOUND AND NOT MINGW)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
endif()
|
||||||
else()
|
|
||||||
message(WARNING "OpenMP not found, geometric operations will be single-threaded")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
|
|
Loading…
Reference in New Issue