From b1098d40a7ca6501049764d360eeab443db16d05 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 30 Apr 2021 18:38:01 +0200 Subject: [PATCH] On windows, try $INCLUDEPY/../libs to detect the Python library path --- waflib/Tools/python.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/waflib/Tools/python.py b/waflib/Tools/python.py index 07442561..fb641e5e 100644 --- a/waflib/Tools/python.py +++ b/waflib/Tools/python.py @@ -416,9 +416,14 @@ def check_python_headers(conf, features='pyembed pyext'): if not result: path = [os.path.join(dct['prefix'], "libs")] - conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY name rather than pythonX.Y (win32)\n") + conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY rather than pythonX.Y (win32)\n") result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $prefix/libs' % name) + if not result: + path = [os.path.normpath(os.path.join(dct['INCLUDEPY'], '..', 'libs'))] + conf.to_log("\n\n# try again with -L$INCLUDEPY/../libs, and pythonXY rather than pythonX.Y (win32)\n") + result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $INCLUDEPY/../libs' % name) + if result: break # do not forget to set LIBPATH_PYEMBED