Skip to content

Commit 677930b

Browse files
committed
fix: make link.exe find PyPy's python*.lib
Point `LIB` environment variable to `libs` directory of extracted PyPy on Windows, so that `link.exe` find it while building Python extensions: https://learn.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-170#link-environment-variables
1 parent 48ee24e commit 677930b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dist/setup/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -90880,6 +90880,10 @@ function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLate
9088090880
// https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3
9088190881
core.exportVariable('Python3_ROOT_DIR', installDir);
9088290882
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
90883+
// https://learn.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-170#link-environment-variables
90884+
if (utils_1.IS_WINDOWS) {
90885+
core.exportVariable('LIB', pythonLocation + '/libs');
90886+
}
9088390887
core.addPath(pythonLocation);
9088490888
core.addPath(_binDir);
9088590889
}

src/find-pypy.ts

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ export async function findPyPyVersion(
9393
// https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3
9494
core.exportVariable('Python3_ROOT_DIR', installDir);
9595
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
96+
// https://learn.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-170#link-environment-variables
97+
if (IS_WINDOWS) {
98+
core.exportVariable('LIB', pythonLocation + '/libs');
99+
}
96100
core.addPath(pythonLocation);
97101
core.addPath(_binDir);
98102
}

0 commit comments

Comments
 (0)