[watchOS] Add platform libraries for watchOS

This commit is contained in:
Ilya Matveev
2019-09-11 13:50:22 +07:00
committed by Ilya Matveev
parent d2a213ffca
commit f305ca82e8
41 changed files with 483 additions and 0 deletions
@@ -0,0 +1,7 @@
depends = CoreAudio CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.AVFoundation
modules = AVFoundation
compilerOpts = -framework AVFoundation
linkerOpts = -framework AVFoundation
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreVideo darwin posix
language = Objective-C
package = platform.Accelerate
modules = Accelerate
compilerOpts = -framework Accelerate
linkerOpts = -framework Accelerate
@@ -0,0 +1,9 @@
depends = CoreFoundation CoreGraphics CoreText Foundation Security UIKit darwin posix
language = Objective-C
package = platform.ClockKit
headers = ClockKit/ClockKit.h
headerFilter = ClockKit/**
compilerOpts = -framework ClockKit
linkerOpts = -framework ClockKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreLocation Foundation Security darwin posix
language = Objective-C
package = platform.CloudKit
modules = CloudKit
compilerOpts = -framework CloudKit
linkerOpts = -framework CloudKit
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.Contacts
modules = Contacts
compilerOpts = -framework Contacts
linkerOpts = -framework Contacts
@@ -0,0 +1,7 @@
depends = CoreFoundation darwin posix
language = Objective-C
package = platform.CoreAudio
modules = CoreAudio
compilerOpts = -framework CoreAudio
linkerOpts = -framework CoreAudio
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.CoreBluetooth
modules = CoreBluetooth
compilerOpts = -framework CoreBluetooth
linkerOpts = -framework CoreBluetooth
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.CoreData
modules = CoreData
compilerOpts = -framework CoreData
linkerOpts = -framework CoreData
@@ -0,0 +1,7 @@
depends = darwin posix
language = Objective-C
package = platform.CoreFoundation
modules = CoreFoundation
compilerOpts = -framework CoreFoundation
linkerOpts = -framework CoreFoundation
@@ -0,0 +1,7 @@
depends = CoreFoundation darwin posix
language = Objective-C
package = platform.CoreGraphics
modules = CoreGraphics
compilerOpts = -framework CoreGraphics
linkerOpts = -framework CoreGraphics
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.CoreLocation
modules = CoreLocation
compilerOpts = -framework CoreLocation
linkerOpts = -framework CoreLocation
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreVideo Foundation Security darwin posix
language = Objective-C
package = platform.CoreML
modules = CoreML
compilerOpts = -framework CoreML
linkerOpts = -framework CoreML
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.CoreMotion
modules = CoreMotion
compilerOpts = -framework CoreMotion
linkerOpts = -framework CoreMotion
@@ -0,0 +1,7 @@
depends = CoreFoundation darwin posix
language = Objective-C
package = platform.CoreServices
modules = CoreServices
compilerOpts = -framework CoreServices
linkerOpts = -framework CoreServices
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics darwin posix
language = Objective-C
package = platform.CoreText
modules = CoreText
compilerOpts = -framework CoreText
linkerOpts = -framework CoreText
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics darwin posix
language = Objective-C
package = platform.CoreVideo
modules = CoreVideo
compilerOpts = -framework CoreVideo
linkerOpts = -framework CoreVideo
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreLocation Foundation Security darwin posix
language = Objective-C
package = platform.EventKit
modules = EventKit
compilerOpts = -framework EventKit
linkerOpts = -framework EventKit
@@ -0,0 +1,7 @@
depends = CoreFoundation Security darwin posix
language = Objective-C
package = platform.Foundation
modules = Foundation
compilerOpts = -framework Foundation
linkerOpts = -framework Foundation
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreText Foundation SceneKit Security SpriteKit UIKit darwin posix
language = Objective-C
package = platform.GameKit
modules = GameKit
compilerOpts = -framework GameKit
linkerOpts = -framework GameKit
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.HealthKit
modules = HealthKit
compilerOpts = -framework HealthKit
linkerOpts = -framework HealthKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics Foundation Security darwin posix
language = Objective-C
package = platform.HomeKit
modules = HomeKit
compilerOpts = -framework HomeKit
linkerOpts = -framework HomeKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics darwin posix
language = Objective-C
package = platform.ImageIO
modules = ImageIO
compilerOpts = -framework ImageIO
linkerOpts = -framework ImageIO
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreLocation CoreText Foundation Security UIKit darwin posix
language = Objective-C
package = platform.MapKit
modules = MapKit
compilerOpts = -framework MapKit
linkerOpts = -framework MapKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreText Foundation Security UIKit darwin posix
language = Objective-C
package = platform.MediaPlayer
modules = MediaPlayer
compilerOpts = -framework MediaPlayer
linkerOpts = -framework MediaPlayer
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreServices darwin posix
language = Objective-C
package = platform.MobileCoreServices
modules = MobileCoreServices
compilerOpts = -framework MobileCoreServices
linkerOpts = -framework MobileCoreServices
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreML CoreVideo Foundation Security darwin posix
language = Objective-C
package = platform.NaturalLanguage
modules = NaturalLanguage
compilerOpts = -framework NaturalLanguage
linkerOpts = -framework NaturalLanguage
@@ -0,0 +1,7 @@
depends = Contacts CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.PassKit
modules = PassKit
compilerOpts = -framework PassKit
linkerOpts = -framework PassKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics Foundation Security darwin posix
language = Objective-C
package = platform.SceneKit
modules = SceneKit
compilerOpts = -framework SceneKit
linkerOpts = -framework SceneKit
@@ -0,0 +1,7 @@
depends = CoreFoundation darwin posix
language = Objective-C
package = platform.Security
modules = Security
compilerOpts = -framework Security
linkerOpts = -framework Security
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreText Foundation Security UIKit darwin posix
language = Objective-C
package = platform.SpriteKit
modules = SpriteKit
compilerOpts = -framework SpriteKit
linkerOpts = -framework SpriteKit
@@ -0,0 +1,7 @@
depends = CoreFoundation CoreGraphics CoreText Foundation Security darwin posix
language = Objective-C
package = platform.UIKit
modules = UIKit
compilerOpts = -framework UIKit
linkerOpts = -framework UIKit
@@ -0,0 +1,9 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.UserNotifications
headers = UserNotifications/UserNotifications.h
headerFilter = UserNotifications/**
compilerOpts = -framework UserNotifications
linkerOpts = -framework UserNotifications
@@ -0,0 +1,7 @@
depends = CoreFoundation Foundation Security darwin posix
language = Objective-C
package = platform.WatchConnectivity
modules = WatchConnectivity
compilerOpts = -framework WatchConnectivity
linkerOpts = -framework WatchConnectivity
@@ -0,0 +1,7 @@
depends = ClockKit CoreFoundation CoreGraphics CoreLocation CoreText Foundation HomeKit MapKit SceneKit Security UIKit darwin posix
language = Objective-C
package = platform.WatchKit
modules = WatchKit
compilerOpts = -framework WatchKit
linkerOpts = -framework WatchKit
@@ -0,0 +1,98 @@
depends = posix
package = platform.builtin
headerFilter = **
language = C
---
// See https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/Builtins.def
// TODO: autogenerate from machine format.
// Returns x with the order of the bytes reversed; for example, 0xaabb becomes 0xbbaa. Byte here always means exactly 8 bits.
static inline short builtin_bswap16(short x) {
return __builtin_bswap16(x);
}
static inline int builtin_bswap32(int x) {
return __builtin_bswap32(x);
}
static inline long long builtin_bswap64(long long x) {
return __builtin_bswap64(x);
}
// Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined.
static inline int builtin_clzs(unsigned short x) {
return __builtin_clzs(x);
}
static inline int builtin_clz(unsigned int x) {
return __builtin_clz(x);
}
static inline int builtin_clzl(unsigned long x) {
return __builtin_clzl(x);
}
static inline int builtin_clzll(unsigned long long x) {
return __builtin_clzll(x);
}
// Returns the number of trailing 0-bits in x, starting at the least significant bit position. If x is 0, the result is undefined.
static inline int builtin_ctzs(unsigned short x) {
return __builtin_ctzs(x);
}
static inline int builtin_ctz(unsigned int x) {
return __builtin_ctz(x);
}
static inline int builtin_ctzl(unsigned long x) {
return __builtin_ctzl(x);
}
static inline int builtin_ctzll(unsigned long long x) {
return __builtin_ctzll(x);
}
// Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero.
static inline int builtin_ffs(int x) {
return __builtin_ffs(x);
}
static inline int builtin_ffsl(long x) {
return __builtin_ffsl(x);
}
static inline int builtin_ffsll(long long x) {
return __builtin_ffsll(x);
}
// Returns the parity of x, i.e. the number of 1-bits in x modulo 2.
static inline int builtin_parity(int x) {
return __builtin_parity(x);
}
static inline int builtin_parityl(unsigned long x) {
return __builtin_parityl(x);
}
static inline int builtin_parityll(unsigned long long x) {
return __builtin_parityll(x);
}
// Returns the number of 1-bits in x.
static inline int builtin_popcount(int x) {
return __builtin_popcount(x);
}
static inline int builtin_popcountl(long x) {
return __builtin_popcountl(x);
}
static inline int builtin_popcountll(long long x) {
return __builtin_popcountll(x);
}
// This function is used to flush the processor's instruction cache for the region of memory between begin inclusive and end exclusive.
static inline void builtin_clear_cache(void* begin, void* end) {
__builtin___clear_cache(begin, end);
}
@@ -0,0 +1,39 @@
depends = posix
language = Objective-C
package = platform.darwin
headers = AssertMacros.h Availability.h AvailabilityInternal.h \
AvailabilityMacros.h Block.h ConditionalMacros.h MacTypes.h \
TargetConditionals.h __cxxabi_config.h _locale.h _types.h _wctype.h \
aio.h asl.h bitstring.h bzlib.h \
cache.h cache_callbacks.h checkint.h compression.h copyfile.h \
cpio.h ctype.h cxxabi.h db.h \
dns.h dns_sd.h dns_util.h execinfo.h \
fmtmsg.h fstab.h \
gethostuuid.h glob.h ifaddrs.h inttypes.h iso646.h \
langinfo.h \
libgen.h libunwind.h \
membership.h monetary.h mpool.h \
nameser.h ndbm.h nl_types.h \
notify.h notify_keys.h ntsid.h \
printf.h \
readpassphrase.h removefile.h \
runetype.h sandbox.h standards.h \
stringlist.h sysdir.h sysexits.h tar.h \
ttyent.h \
unwind.h util.h utmpx.h vis.h wordexp.h xattr_flags.h \
bank/bank_types.h \
bsm/audit.h \
os/activity.h os/availability.h os/base.h os/lock.h \
os/log.h os/object.h os/overflow.h os/trace.h \
simd/simd.h sys/sysctl.h
headerFilter = **
excludedFunctions = __tg_promote
compilerOpts = -D_XOPEN_SOURCE -DSYSCTL_DEF_ENABLED
linkerOpts = -ldl -lz
---
// AppleTextureEncoder.h is not available for WatchOS simulator
// menu.h is excluded so far due to interop issues.
@@ -0,0 +1,5 @@
depends = posix
package = platform.iconv
headers = iconv.h
headerFilter = **
linkerOpts = -liconv
@@ -0,0 +1,13 @@
depends = darwin posix
language = Objective-C
package = platform.objc
headers = objc/NSObjCRuntime.h objc/NSObject.h objc/message.h objc/objc-api.h \
objc/objc-exception.h objc/objc-sync.h objc/objc.h objc/runtime.h
headerFilter = objc/**
compilerOpts = -D_XOPEN_SOURCE
linkerOpts = -lobjc
---
// objc-auto.h is excluded so far due to interop issues.
@@ -0,0 +1,43 @@
depends =
package = platform.posix
headers = alloca.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl.h \
fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \
locale.h math.h memory.h netdb.h paths.h poll.h \
pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h signal.h \
stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \
time.h ucontext.h unistd.h utime.h wchar.h wctype.h xlocale.h \
net/ethernet.h net/if.h \
netinet/icmp6.h netinet/in.h netinet/in_systm.h \
netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \
sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h \
sys/queue.h sys/select.h sys/shm.h sys/stat.h \
sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h
compilerOpts = -D_XOPEN_SOURCE
linkerOpts = -ldl
---
// Wrapper to access errno variable.
static int posix_errno() {
return errno;
}
static void set_posix_errno(int value) {
errno = value;
}
// Wrapper to access h_errno variable.
static int posix_h_errno() {
return h_errno;
}
static void set_posix_h_errno(int value) {
h_errno = value;
}
static int init_sockets() {
return 0;
}
static void deinit_sockets() {
}
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
../../../../dist/bin/run_konan defFileDependencies \
-target watchos_arm32 \
-target watchos_x86 \
*.def
#TODO: Reenable targets
# -target watchos_arm64 \
# -target watchos_x64 \
@@ -0,0 +1,34 @@
depends = posix
package = platform.zlib
headers = zconf.h zlib.h
headerFilter = zconf.h zlib.h
compilerOpts = -DByte=uByte -DBytef=uBytef
linkerOpts = -lz
---
#undef deflateInit
static inline int deflateInit(z_streamp strm, int level) {
return deflateInit_(strm, level, ZLIB_VERSION, (int)sizeof(z_stream));
}
#undef deflateInit2
static inline int deflateInit2(z_streamp strm, int level, int method,
int windowBits, int memLevel, int strategy) {
return deflateInit2_(strm, level, method, windowBits, memLevel,
strategy, ZLIB_VERSION, (int)sizeof(z_stream));
}
#undef inflateInit
static inline int inflateInit(z_streamp strm) {
return inflateInit_(strm, ZLIB_VERSION, (int)sizeof(z_stream));
}
#undef inflateInit2
static inline int inflateInit2(z_streamp strm, int windowBits) {
return inflateInit2_(strm, windowBits, ZLIB_VERSION, (int)sizeof(z_stream));
}
#undef inflateBackInit
static inline int inflateBackInit(z_streamp strm, int windowBits, unsigned char *window) {
return inflateBackInit_(strm, windowBits, window, ZLIB_VERSION, (int)sizeof(z_stream));
}