cmake: stub the addon object library when it is header-only#165
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
avnd_addon_objectbuilds the object as a STATIC library directly fromSOURCES.A header-only object (no
.cpp/.mm/… TU) yields an empty archive: GNUartolerates it, but macOS
arand MSVClibreject it with "no archive membersspecified", 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
SOURCEScontains no translation unit.Validation
Built a header-only
avnd_addon_objectagainst this branch: the object archivetiny.anow containstiny_avnd_obj_stub.cpp.o(was empty before). This isexactly the failure hit by
carto-tcp-avendishon macOS/Windows CI.🤖 Generated with Claude Code
https://claude.ai/code/session_014Z4KK2Rays9dTj8J2AJcFZ