Skip to content

Commit

Permalink
- try to find lib to use on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Oct 28, 2022
1 parent 7e905aa commit 57779dd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def get_python_include():
# for whatever reason 2.7 on centos returns a wrong path here
return sysconfig.get_config_vars()['INCLUDEPY']

def get_win_python_lib():
vars = sysconfig.get_config_vars()
path = os.path.join(vars['prefix'], 'libs', 'python' + vars['py_version_nodot'] + '.lib')
if os.path.exists(path):
return path
return None

def prepend_variables(args, variables):
for var in variables:
temp = os.getenv(var)
Expand Down Expand Up @@ -252,6 +259,7 @@ def build_cmake(self, extension):
'-DPYTHON_INCLUDE_DIR=' + get_python_include()
]


for package in packages:
libsbml_args.append('-DENABLE_{0}=ON'.format(package.upper()))

Expand All @@ -262,6 +270,11 @@ def build_cmake(self, extension):

if not is_win:
libsbml_args.append('-DPYTHON_USE_DYNAMIC_LOOKUP=ON')
else:
lib_path = get_win_python_lib()
if lib_path is not None:
libsbml_args.append('-DPYTHON_LIBRARY={0}'.format(lib_path))


cmake_args = cmake_args + libsbml_args

Expand Down

0 comments on commit 57779dd

Please sign in to comment.