Skip to content

Xcode: Restore suppression of header maps

Brad King requested to merge brad.king/cmake:xcode-revert-header-map into master

In !8143 (merged) we dropped the Xcode build setting USE_HEADERMAP = NO because Xcode 14's "Build Documentation" feature:

$ xcodebuild RUN_DOCUMENTATION_COMPILER=YES

fails in some cases without header maps. However, enabling header maps causes Xcode to add -iquote .../foo.hmap and -I .../bar.hmap flags that can change the intended header file search order based on the contents of the header maps. This can break existing projects. Restore the USE_HEADERMAP = NO setting to fix the header file search order.

Further investigation will be needed to resolve the problematic cases with the Xcode 14 "Build Documentation" feature. Meanwhile projects encountering such cases can set the XCODE_ATTRIBUTE_USE_HEADERMAP target property to YES themselves.

Fixes: #24418 (closed)
Issue: #24379
Backport: release

Edited by Brad King

Merge request reports