}
if (is_ios) {
- ios_sysroot = exec_script("find_ios_sysroot.py", [], "trim string")
+ if (is_tvos) {
+ sdk = "appletvos"
+ if (target_cpu == "x86" || target_cpu == "x64") {
+ sdk = "appletvsimulator"
+ }
+ ios_sysroot = exec_script("find_ios_sysroot.py", [ sdk ], "trim string")
+ } else {
+ sdk = "iphoneos"
+ if (target_cpu == "x86" || target_cpu == "x64") {
+ sdk = "iphonesimulator"
+ }
+ ios_sysroot = exec_script("find_ios_sysroot.py", [ sdk ], "trim string")
+ }
}
config("default") {
}
if (is_ios) {
+ _target = target_cpu
+ if (target_cpu == "arm") {
+ _target = "armv7"
+ } else if (target_cpu == "x86") {
+ _target = "i386"
+ } else if (target_cpu == "x64") {
+ _target = "x86_64"
+ }
cflags += [
"-isysroot",
ios_sysroot,
"-arch",
- target_cpu,
+ _target,
]
+ if (is_tvos) {
+ cflags += [
+ "-fembed-bitcode"
+ ]
+ }
cflags_cc += [ "-stdlib=libc++" ]
ldflags += [
"-isysroot",
ios_sysroot,
"-arch",
- target_cpu,
+ _target,
"-stdlib=libc++",
]
libs += [ "objc" ]
]
} else {
cflags = [
- "-O3",
+ "-Os",
"-momit-leaf-frame-pointer",
]
}
is_android = current_os == "android"
is_fuchsia = current_os == "fuchsia"
-is_ios = current_os == "ios"
+is_ios = current_os == "ios" || current_os == "tvos"
+is_tvos = current_os == "tvos"
is_linux = current_os == "linux"
is_mac = current_os == "mac"
is_win = current_os == "win"
# found in the LICENSE file.
import subprocess
+import sys
-print subprocess.check_output('xcrun --sdk iphoneos --show-sdk-path'.split())
+sdk = sys.argv[1:]
+
+print subprocess.check_output(['xcrun', '--sdk', '%s' % sdk[0], '--show-sdk-path'])
"../externals/libjpeg-turbo/jutils.c",
]
- if (current_cpu == "arm" && current_os != "ios") {
+ if (current_cpu == "arm" && !is_ios) {
sources += [
"../externals/libjpeg-turbo/simd/jsimd_arm.c",
"../externals/libjpeg-turbo/simd/jsimd_arm_neon.S",
]
- } else if (current_cpu == "arm64" && current_os != "ios") {
+ } else if (current_cpu == "arm64" && !is_ios) {
sources += [
"../externals/libjpeg-turbo/simd/jsimd_arm64.c",
"../externals/libjpeg-turbo/simd/jsimd_arm64_neon.S",