Skip to content

fix(cmake): don't pass REQUIRED to find_dependency in package config - #1

Merged
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478
Jul 30, 2026
Merged

fix(cmake): don't pass REQUIRED to find_dependency in package config#1
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478

Conversation

@hoshimoe

Copy link
Copy Markdown
Owner

Summary

Upstream fix for feedback a vcpkg maintainer gave while reviewing microsoft/vcpkg#53099:

find_dependency must generally not have REQUIRED or QUIET; the whole point of find_dependency is to forward the REQUIRED or QUIET-ness requested by the caller.

NekoThreadPoolConfig.cmake.in hard-coded REQUIRED, so find_package(NekoThreadPool CONFIG QUIET) raised a fatal error when NekoSchema was absent instead of returning a graceful -NOTFOUND, which is what a QUIET caller expects.

Change

  • find_dependency(NekoSchema REQUIRED)find_dependency(NekoSchema)

Verification

Built and installed into a local prefix, then configured a consumer project against the installed package:

Caller NekoSchema Result
find_package(NekoThreadPool CONFIG QUIET) missing exit 0, NekoThreadPool_FOUND=0 (was: fatal error)
find_package(NekoThreadPool CONFIG REQUIRED) missing fatal error — correct
find_package(NekoThreadPool CONFIG REQUIRED) present exit 0, FOUND=1, VERSION=1.0.2

The REQUIRED+present case additionally compiled and linked a consumer against Neko::ThreadPool. The pre-change config was re-tested to confirm it really did hard-fail the QUIET caller.

Version metadata is already consistent here — project(NekoThreadPool VERSION 1.0.2) matches the packaged 1.0.2.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WMgcdYggBJ6aMCuNXYbRZT


Generated by Claude Code

find_dependency() forwards the REQUIRED/QUIET-ness requested by the caller
of find_package(); hard-coding REQUIRED defeats that. A consumer doing
find_package(NekoThreadPool CONFIG QUIET) got a fatal error instead of a graceful
-NOTFOUND when a transitive dependency was absent.

Reported by a vcpkg maintainer in microsoft/vcpkg#53099.
@hoshimoe
hoshimoe merged commit 8e1bcd2 into main Jul 30, 2026
19 of 23 checks passed
@hoshimoe
hoshimoe deleted the claude/neko-upstream-issues-693478 branch July 30, 2026 22:59
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.

2 participants