Skip to content

Commit 6756e54

Browse files
committed
Fix Boost.Python libname finding
1 parent 5760eea commit 6756e54

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

codepy/libraries.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ def update_config(fname: str) -> None:
117117

118118
def get_boost_libname(basename: str, aksetup: Config) -> list[str]:
119119
varname = f"BOOST_{basename.upper()}_LIBNAME"
120-
libs = getlist(aksetup, varname, [f"boost_{basename}"])
120+
default = f"boost_{basename}"
121+
if basename == "python":
122+
import sys
123+
version = sys.version_info[:2]
124+
default = "boost_python{}{}".format(*version)
125+
libs = getlist(aksetup, varname, [default])
121126

122127
return libs
123128

@@ -133,7 +138,7 @@ def add_boost_python(toolchain: Toolchain) -> None:
133138
getlist(aksetup, "BOOST_INC_DIR", []),
134139
getlist(aksetup, "BOOST_LIB_DIR", []),
135140
[
136-
*get_boost_libname("python{}{}".format(*version), aksetup),
141+
*get_boost_libname("python", aksetup),
137142
"python{}.{}{}".format(*version, sys.abiflags),
138143
])
139144

0 commit comments

Comments
 (0)