Skip to content

Commit b25d337

Browse files
committed
Fix arx detection for cp313 and cp314 as well.
1 parent 2eb5c7d commit b25d337

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,10 @@ def to_win_path(pt: Path):
255255
# see https://github.com/rdkit/rdkit/blob/498f57a4eb99a67d842cbc3f89f94b302f398a11/CMakeLists.txt#L376C59-L376C95
256256
# remove "-arch x86_64" from PYTHON_LDSHARED
257257
if "cp313" in os.environ["CIBW_BUILD"] or "cp314" in os.environ["CIBW_BUILD"]:
258-
old = '${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var(\'LDSHARED\').lstrip().split(\' \', 1)[1])"'
259-
new = '${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var(\'LDSHARED\').lstrip().split(\' \', 1)[1].replace(\'-arch x86_64\', \'\'))"'
260-
replace_all("CMakeLists.txt", old, new)
258+
for python_var in ("Python3_EXECUTABLE", "Python_EXECUTABLE"):
259+
old = f'${{{python_var}}} -c "import sysconfig; print(sysconfig.get_config_var(\'LDSHARED\').lstrip().split(\' \', 1)[1])"'
260+
new = f'${{{python_var}}} -c "import sysconfig; print(sysconfig.get_config_var(\'LDSHARED\').lstrip().split(\' \', 1)[1].replace(\'-arch x86_64\', \'\'))"'
261+
replace_all("CMakeLists.txt", old, new)
261262

262263

263264
if "linux" in sys.platform:

0 commit comments

Comments
 (0)