Skip to content

Silence libtool empty-object warnings for static Xcode builds - #274

Merged
danoli3 merged 1 commit into
masterfrom
fix/apple-libtool-empty-objects
Nov 9, 2026
Merged

danoli3 merged 1 commit into
masterfrom
fix/apple-libtool-empty-objects

Conversation

@danoli3

@danoli3 danoli3 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Some bundled sources are intentionally empty on a given platform or feature set (guarded out), and Apple's libtool prints has no symbols for each one when the Xcode generator archives FreeImage.a.

This appends -no_warning_for_no_symbols to STATIC_LIBRARY_OPTIONS for the Xcode generator only (Ninja and Makefile generators may use ar, which rejects the flag), and adds a README note for consumers who repack FreeImage.a and need the same option.

Tested on macOS (Xcode 27.2), -G Xcode -DFREEIMAGE_STATIC=ON, Release build of the FreeImage target: 15 has no symbols warnings without the change, 0 with it. The Ninja configure is unchanged (the flag does not appear in build.ninja).

Platform and feature guards intentionally leave some bundled sources empty, and Apple's libtool warns about each when the Xcode generator archives them. Pass -no_warning_for_no_symbols through STATIC_LIBRARY_OPTIONS for the Xcode generator only; Ninja and Makefile generators may use ar, which rejects the flag. Document it for consumers that repack FreeImage.a.
@danoli3
danoli3 force-pushed the fix/apple-libtool-empty-objects branch from 71393a7 to ef04c45 Compare November 9, 2026 11:42
@danoli3
danoli3 merged commit 702f514 into master Nov 9, 2026
97 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