From 083b78bcdc1a14ca405040931830faa2cea05ace Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Wed, 1 Jan 2020 18:45:41 +0930 Subject: [PATCH] Support OpenMP on Windows --- appveyor.yml | 2 ++ dust3d.pro | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f61872d1..d364872d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,6 +36,7 @@ after_test: # Check Qt plugins by following https://wiki.qt.io/Deploy_an_Application_on_Windows - set /p VCRedistVersion=<"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt" - set VCREDIST_CRT_DIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\%VCRedistVersion%\%PLATFORM%\Microsoft.VC141.CRT + - set VCREDIST_OPENMP_DIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\%VCRedistVersion%\%PLATFORM%\Microsoft.VC141.OPENMP - set TAG=%APPVEYOR_REPO_TAG_NAME% - if "%TAG%" == "" @@ -55,6 +56,7 @@ after_test: - 7z a dust3d-%TAG%-%PLATFORM%.zip %QTDIR%\bin\Qt5Network.dll - 7z a dust3d-%TAG%-%PLATFORM%.zip "%VCREDIST_CRT_DIR%\msvcp140.dll" - 7z a dust3d-%TAG%-%PLATFORM%.zip "%VCREDIST_CRT_DIR%\vcruntime140.dll" + - 7z a dust3d-%TAG%-%PLATFORM%.zip "%VCREDIST_OPENMP_DIR%\vcomp140.dll" - mkdir platforms - copy %QTDIR%\plugins\platforms\qwindows.dll %APPVEYOR_BUILD_FOLDER%\platforms\qwindows.dll - 7z a dust3d-%TAG%-%PLATFORM%.zip -r %APPVEYOR_BUILD_FOLDER%\platforms\ diff --git a/dust3d.pro b/dust3d.pro index 0c4c1d50..13ff6b51 100644 --- a/dust3d.pro +++ b/dust3d.pro @@ -503,13 +503,18 @@ INCLUDEPATH += thirdparty/QuadriFlow/3rd/pss INCLUDEPATH += thirdparty/QuadriFlow/3rd/lemon-1.3.1 macx: { - exists(/usr/local/opt/libomp) { -# Install OpenMP: brew install libomp - DEFINES += WITH_OMP - QMAKE_CXXFLAGS += -Xpreprocessor -fopenmp - INCLUDEPATH += /usr/local/opt/libomp/include - LIBS += -L/usr/local/opt/libomp/lib -lomp + !exists(/usr/local/opt/libomp) { + error("Please install OpenMP: brew install libomp") } + DEFINES += WITH_OMP + QMAKE_CXXFLAGS += -Xpreprocessor -fopenmp + INCLUDEPATH += /usr/local/opt/libomp/include + LIBS += -L/usr/local/opt/libomp/lib -lomp +} + +win32 { + QMAKE_CXXFLAGS += /openmp + DEFINES += WITH_OMP } win32 {