[sw] Fix mingw build.

This commit is contained in:
Egor Pugin 2020-03-17 17:57:10 +03:00
parent 04a7650b51
commit 916875d74a

11
sw.cpp
View File

@ -60,6 +60,11 @@ void build(Solution &s)
}
}
auto win_or_mingw =
libtesseract.getBuildSettings().TargetOS.Type == OSType::Windows ||
libtesseract.getBuildSettings().TargetOS.Type == OSType::Mingw
;
// check fma flags
libtesseract -= "src/arch/dotproductfma.cpp";
@ -69,9 +74,9 @@ void build(Solution &s)
libtesseract["src/arch/dotproductsse.cpp"].args.push_back("-msse4.1");
libtesseract["src/arch/intsimdmatrixsse.cpp"].args.push_back("-msse4.1");
libtesseract["src/arch/intsimdmatrixavx2.cpp"].args.push_back("-mavx2");
libtesseract += "pthread"_slib;
}
if (!win_or_mingw)
libtesseract += "pthread"_slib;
libtesseract.Public += "HAVE_CONFIG_H"_d;
libtesseract.Public += "_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1"_d;
@ -82,7 +87,7 @@ void build(Solution &s)
libtesseract.Public += "org.sw.demo.danbloomberg.leptonica"_dep;
libtesseract.Public += "org.sw.demo.libarchive.libarchive"_dep;
if (libtesseract.getBuildSettings().TargetOS.Type == OSType::Windows)
if (win_or_mingw)
{
libtesseract.Public += "ws2_32.lib"_slib;
libtesseract.Protected += "NOMINMAX"_def;