Browse Source

[sw] Fix mingw build.

Egor Pugin 1 year ago
parent
commit
916875d74a
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      sw.cpp

+ 8
- 3
sw.cpp

@@ -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;