Я собираю stati c библиотеку iOS / macOS для Ma c Catalyst, используя следующие флаги:
clang \
--target=x86_64-apple-ios13-macabi \
-isysroot /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
Это создает исходные файлы vanilla, но не с:
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#endif
Поскольку TARGET_OS_ IPHONE определено, похоже, что целевой флаг работает. Однако UIKit / UIKit.h не найден, даже если он находится в SDK:
$ find -L /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -name UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Versions/A/Headers/UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Versions/Current/Headers/UIKit.h
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h
Нужно ли явно указывать структуру UIKit?