Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: fix python path with use multi-version python #2143

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

xz-dev
Copy link
Contributor

@xz-dev xz-dev commented Oct 23, 2024

If I use python3.13 as my system python version, but I use python3.12 to create venv, cmake will find /usr/bin/python3.13 but not venv

Because cmake will use the latest version.

From https://cmake.org/cmake/help/latest/module/FindPython3.html

Note
This hint has the lowest priority of all hints, so even if, for example, you specify IronPython first and CPython in second, a python product based on CPython can be selected because, for example with Python3_FIND_STRATEGY=LOCATION, each location will be search first for IronPython and second for CPython.

Refer: https://discourse.cmake.org/t/find-package-python3-is-not-finding-the-correct-python/10563

Copy link

github-actions bot commented Oct 23, 2024

Build size and comparison to main:

Section Size Difference
text 374512B -16B
data 948B 0B
bss 63488B 0B

Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! We could also set the CMP0094 policy to NEW, which would achieve the same thing, but I think this is more clear to readers of the code.

@mark9064 mark9064 merged commit a77a3dc into InfiniTimeOrg:main Nov 17, 2024
5 checks passed
@FintasticMan FintasticMan added this to the 1.15.0 milestone Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants