Skip to content

cmake: Fix VERSION_EQUAL checks to compare only major.minor #385

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

Merged

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented May 7, 2025

The existing use of VERSION_EQUAL assumed a patch version of .0 (e.g. 3.2.0), which breaks for any 3.2.x release. Change the comparison to use only the major and minor components (e.g. 3.2) so that all patch‐level variants are correctly recognized.

Fix regression originally introduced in the following commits:

  • 7b6b8fa ("datetime, time: Fix build conditionally including _time.c or timemodule.c", 2022-01-18)
  • 39e9d3d ("cmake: Simplify removing versioned variables", 2025-05-01)
  • 8943355 ("cmake: Simplify extension build-system using genex to include _time.c", 2025-05-05)

Working toward addressing:

Follow-up of:

The existing use of VERSION_EQUAL assumed a patch version of `.0` (e.g. `3.2.0`),
which breaks for any `3.2.x` release. Change the comparison to use only
the major and minor components (e.g. `3.2`) so that all patch‐level variants
are correctly recognized.

Fix regression originally introduced in the following commits:
* 7b6b8fa ("datetime, time: Fix build conditionally including _time.c or timemodule.c", 2022-01-18)
* 39e9d3d ("cmake: Simplify removing versioned variables", 2025-05-01)
* 8943355 ("cmake: Simplify extension build-system using genex to include _time.c", 2025-05-05)
@jcfr jcfr enabled auto-merge (rebase) May 7, 2025 20:51
@jcfr jcfr merged commit 2514150 into python-cmake-buildsystem:master May 7, 2025
16 checks passed
@jcfr jcfr deleted the fix-version-equal-compare branch May 7, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant