Skip to content

cmake: stub the addon object library when it is header-only#165

Merged
jcelerier merged 1 commit into
mainfrom
fix-header-only-object-lib
Jul 9, 2026
Merged

cmake: stub the addon object library when it is header-only#165
jcelerier merged 1 commit into
mainfrom
fix-header-only-object-lib

Conversation

@jcelerier

Copy link
Copy Markdown
Member

Problem

avnd_addon_object builds the object as a STATIC library directly from SOURCES.
A header-only object (no .cpp/.mm/… TU) yields an empty archive: GNU ar
tolerates it, but macOS ar and MSVC lib reject it with "no archive members
specified"
, breaking the build for any single-header addon (e.g. a header-only
TouchDesigner POP).

Fix

The base target already guards this with a generated empty stub TU; apply the
same to the object library when SOURCES contains no translation unit.

Validation

Built a header-only avnd_addon_object against this branch: the object archive
tiny.a now contains tiny_avnd_obj_stub.cpp.o (was empty before). This is
exactly the failure hit by carto-tcp-avendish on macOS/Windows CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Z4KK2Rays9dTj8J2AJcFZ

avnd_addon_object builds the object as a STATIC library straight from SOURCES.
A header-only object (no .cpp/.mm/... translation unit) therefore yields an empty
archive: GNU ar tolerates it, but macOS ar and MSVC lib reject it with
'no archive members specified', failing the build for any header-only addon (e.g.
a single-header TouchDesigner POP). The base target already guards against this
with a generated empty stub TU; apply the same to the object library.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Z4KK2Rays9dTj8J2AJcFZ
@jcelerier
jcelerier merged commit 55d5572 into main Jul 9, 2026
23 checks passed
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.

1 participant