Skip to content

Xcode: Link libraries using "Link Binary With Libraries"

Gusts Kaksis requested to merge gusc/cmake:xcode-link-libs into master

This optionally adds a "Link Binary With Libraries" block and adding all the dependency target output library files to it instead of linker flags.

Problem description in detail:

It fixes a linker issue of missing libraries when building an .xcarchive, because any dependency targets that generate libraries are built in different build paths than for a regular build. The problem was that all the libraries are linked with hard-coded absolute paths through linker flags (OTHER_LDFLAGS). Instead we need to leave path and linker argument management to Xcode, but only for targets that are affected by the same Xcode build. Other libraries that are linked with absolute paths or -l argument are not affected.

Fixes: #14185 (closed)

Edited by Craig Scott

Merge request reports