Skip to content

Commit 012df50

Browse files
committed
Update
[ghstack-poisoned]
1 parent deb58fd commit 012df50

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,17 @@ def _write_cmake_version_file(destination: str) -> None:
388388
# SameMajorVersion, matching the runtime's SONAME: a consumer asking for {major}.x
389389
# gets any {major}.y, and a request for a different major is refused because the
390390
# shared runtime it would link is not the one it asked for.
391-
set(PACKAGE_VERSION_COMPATIBLE TRUE)
392-
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
393-
set(PACKAGE_VERSION_EXACT TRUE)
391+
#
392+
# A request above this version is refused too. Matching only the major would let a
393+
# package satisfy a request for a release it predates, so a consumer needing something
394+
# added later would link this runtime instead of being told it is not here.
395+
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
396+
set(PACKAGE_VERSION_UNSUITABLE TRUE)
397+
else()
398+
set(PACKAGE_VERSION_COMPATIBLE TRUE)
399+
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
400+
set(PACKAGE_VERSION_EXACT TRUE)
401+
endif()
394402
endif()
395403
else()
396404
set(PACKAGE_VERSION_UNSUITABLE TRUE)

0 commit comments

Comments
 (0)