IGListKit/Source/IGListDiffKit/IGListCompatibility.h
Cameron Roth 86f208f7a1 Fix public compilation by making METAUIKitBridge conditional
Summary:
`IGListKit` was failing to compile in public/open source builds (SPM, CocoaPods) because it unconditionally imported an internal library `METAUIKitBridge` on macOS.

The issue:
- The header `#import <METAUIKitBridge/METAUIKitBridge.h>` would fail to resolve

The fix:
- Use `__has_include` to conditionally import METAUIKitBridge only when available
- Fall back to plain `Cocoa/Cocoa.h` for public builds

This preserves internal macOS functionality while allowing the open source version of `IGListKit` to compile without the Meta-internal dependency.

Differential Revision: D101185193

fbshipit-source-id: 40cd9d9ce1bc5ad7e78cf190ced111e179e3badb
2026-04-16 12:51:41 -07:00

18 lines
484 B
Objective-C

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <TargetConditionals.h>
#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST
#import <UIKit/UIKit.h>
#else // TARGET_OS_OSX
#if __has_include(<METAUIKitBridge/METAUIKitBridge.h>)
#import <METAUIKitBridge/METAUIKitBridge.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#endif