Commit 93153c90affd86730d044a390ef7115e27c37618

SSE4 2019-02-22T03:24:23

- some workarounds for MinGW Signed-off-by: SSE4 <tomskside@gmail.com>

diff --git a/appveyor.yml b/appveyor.yml
index fa23ce1..aab762f 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -4,6 +4,7 @@ environment:
     matrix:
         - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
           CMAKE_GENERATOR: "MinGW Makefiles"
+          CMAKE_MAKE_PROGRAM: "C:\\MinGW\\bin\\mingw32-make.exe"
           CC: "C:\\MinGW\\bin\\gcc.exe"
         - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
           CMAKE_GENERATOR: "Visual Studio 12 2013"
diff --git a/build.py b/build.py
index 103c931..0d13348 100644
--- a/build.py
+++ b/build.py
@@ -10,9 +10,22 @@ def run(command):
     if 0 != status:
         sys.exit(command)
 
+def remove_sh_from_path():
+    path = os.environ["PATH"]
+    path = path.split(os.pathsep)
+    for entry in path:
+        if os.path.isfile(os.path.join(entry, "sh.exe")):
+            path.remove(entry)
+    path = os.pathsep.join(path)
+    os.environ["PATH"] = path
+
 def main():
+    remove_sh_from_path()
     generator = os.environ["CMAKE_GENERATOR"]
-    run('cmake . -G "%s"' % generator)
+    command = 'cmake . -G "%s"' % generator
+    if "CMAKE_MAKE_PROGRAM" in os.environ:
+        command += "-D%s" % os.environ["CMAKE_MAKE_PROGRAM"]
+    run(command)
     run('cmake --build . --config Release')
 
 if __name__ == '__main__':