File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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()
395403else()
396404 set(PACKAGE_VERSION_UNSUITABLE TRUE)
You can’t perform that action at this time.
0 commit comments