Skip to content

Commit

Permalink
add convertion of msys-libdir to windows-bindir
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed Aug 20, 2020
1 parent b0ce0dc commit 0a1ca61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gamsinst.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
import os
import subprocess
import shutil

def print_usage() :
Expand Down Expand Up @@ -60,6 +61,11 @@ def print_usage() :
print("Error: no libdir or dlname found in", solverlib, file=sys.stderr)
print_usage()
sys.exit(1)
if iswindows :
# convert msys-path to windows path
libdir = subprocess.check_output("cygpath -w " + libdir).decode("utf-8").strip()
# on Windows, DLLs are in bindir and not in libdir, assume bindir is libdir/../bin
libdir = os.path.join(libdir, '..', 'bin')
solverlib = os.path.join(libdir, dlname)
if not os.path.isfile(solverlib) :
print("Error: %s does not exist or is not a file" % solverlib, file=sys.stderr)
Expand Down

0 comments on commit 0a1ca61

Please sign in to comment.