mirror of
https://github.com/Instagram/IGListKit
synced 2026-04-21 13:37:19 +00:00
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
18 lines
484 B
Objective-C
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
|