Skip to content

Xcode: Fix object library builds with sanitizers enabled

Brad King requested to merge brad.king/cmake:xcode-object-dir into master

Using xcodebuild -enableAddressSanitizer YES ... causes object files to be placed in a different directory name. Xcode provides a placeholder for this that we can use in OTHER_LDFLAGS to reference object files for linking the dependents of object libraries. However, CMake's features for installing and exporting object libraries depend on knowing the real path with no placeholders. For these cases, use the default object directory. Users will then have to choose between sanitizers and the installation and export features, but both will work individually.

Fixes: #16289 (closed)

Edited by Brad King

Merge request reports