Skip to content

transport: tighten picoquic guard to require imported target#232

Open
gmarzot wants to merge 1 commit into
mainfrom
hotfix/picoquic-guard-target-only
Open

transport: tighten picoquic guard to require imported target#232
gmarzot wants to merge 1 commit into
mainfrom
hotfix/picoquic-guard-target-only

Conversation

@gmarzot
Copy link
Copy Markdown
Collaborator

@gmarzot gmarzot commented May 25, 2026

Closes #76.

Problem

moxygen/openmoq/transport/CMakeLists.txt guarded the pico transport subdirectory with:

if(picoquic_FOUND OR TARGET picoquic::picoquic-core)

Upstream picoquic's cmake config (picoquic-config.cmake) sets picoquic_FOUND=TRUE and populates picoquic_LIBRARIES but does not define the picoquic::picoquic-core IMPORTED target. So with a system-installed picoquic the guard passes, the subdirectory is added, and target_link_libraries(... picoquic::picoquic-core) then fails at generate time:

Target "openmoq_pico_transport" links to target "picoquic::picoquic-core"
but the target was not found.

Fix

Check the imported target directly:

if(TARGET picoquic::picoquic-core)

This is the right check — picoquic_FOUND says "some picoquic was found by the legacy variables" but not "the modern target was defined". FetchContent builds and openmoq's picoquic submodule both define the target so they continue to work.

Impact

  • CI is unaffected (no picoquic installed on the runners)
  • Local builds with system-installed picoquic now configure cleanly instead of failing at generate time
  • The temporary workaround in the issue (sudo mv /usr/local/lib/cmake/picoquic/picoquic-config.cmake{,.bak}) is no longer needed

This change is Reviewable

picoquic_FOUND alone is not sufficient — upstream picoquic's
picoquic-config.cmake sets picoquic_FOUND=TRUE but does not define the
picoquic::picoquic-core IMPORTED target. With the previous guard the
subdirectory got added but the subsequent target_link_libraries on
picoquic::picoquic-core failed at generate time.

Check the imported target directly.

Closes #76.
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.

picoquic guard in transport/CMakeLists.txt breaks with system-installed picoquic

1 participant