onnxruntime
7a32d0ac - [build] ensure Python to be found in vcpkg (#24713)

Commit
359 days ago
[build] ensure Python to be found in vcpkg (#24713) ### Description <!-- Describe your changes. --> Sometimes Python cannot be found by CMake when using vcpkg. This is because vcpkg does not inherit environment `PATH` from the parent process when launching CMake (which is intentionally done by vcpkg), and in this case, a non-standard Python installation (eg. virtual env or conda) may fail the `find_package(Python3 REQUIRED)`. This PR write the env variable `Python3_ROOT_DIR` and adds it to `VCPKG_KEEP_ENV_VARS` to ensure CMake launched by vcpkg to be able to always find Python that runs `build.py`. This change should not break the existing behavior unless there are scenarios that intentionally uses different python for running build.py and vcpkg build.
Author
Parents
Loading