mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-20 15:59:11 +08:00
Bugfix OpenMP with Visual Studio (#3475)
* Bugfix OpenMP with Visual Studio * Test for working VS2019 update instead of first version of VS2019
This commit is contained in:
parent
a701454ae5
commit
4d0f027f58
@ -256,6 +256,9 @@ if(CLANG) # clang all platforms
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DDEBUG -pedantic -O0")
|
||||
endif()
|
||||
|
||||
if (OPENMP_BUILD AND MSVC AND ${MSVC_VERSION} LESS 1929)
|
||||
set(OPENMP_BUILD OFF)
|
||||
endif()
|
||||
if (OPENMP_BUILD)
|
||||
find_package(OpenMP QUIET)
|
||||
if (OpenMP_FOUND)
|
||||
@ -280,6 +283,10 @@ if (OPENMP_BUILD)
|
||||
set(OpenMP_FOUND 1)
|
||||
add_definitions(-D_OPENMP=201107) # 3.1 version is supported from Clang 3.8.0
|
||||
endif()
|
||||
if (MSVC)
|
||||
string(REPLACE "/openmp" "/openmp:llvm" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
string(REPLACE "-openmp" "/openmp:llvm" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CYGWIN)
|
||||
|
Loading…
Reference in New Issue
Block a user