|
@@ -33,6 +33,7 @@ def get_opts():
|
|
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain",
|
|
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain",
|
|
),
|
|
),
|
|
("IPHONESDK", "Path to the iPhone SDK", ""),
|
|
("IPHONESDK", "Path to the iPhone SDK", ""),
|
|
|
|
+ BoolVariable("ios_simulator", "Build for iOS Simulator", False),
|
|
BoolVariable("ios_exceptions", "Enable exceptions", False),
|
|
BoolVariable("ios_exceptions", "Enable exceptions", False),
|
|
("ios_triple", "Triple for ios toolchain", ""),
|
|
("ios_triple", "Triple for ios toolchain", ""),
|
|
]
|
|
]
|
|
@@ -106,26 +107,35 @@ def configure(env):
|
|
|
|
|
|
## Compile flags
|
|
## Compile flags
|
|
|
|
|
|
- if env["arch"] == "x86" or env["arch"] == "x86_64":
|
|
|
|
|
|
+ if env["ios_simulator"]:
|
|
detect_darwin_sdk_path("iphonesimulator", env)
|
|
detect_darwin_sdk_path("iphonesimulator", env)
|
|
|
|
+ env.Append(CCFLAGS=["-mios-simulator-version-min=10.0"])
|
|
|
|
+ env.Append(LINKFLAGS=["-mios-simulator-version-min=10.0"])
|
|
|
|
+ env.extra_suffix = ".simulator" + env.extra_suffix
|
|
|
|
+ else:
|
|
|
|
+ detect_darwin_sdk_path("iphone", env)
|
|
|
|
+ env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
|
|
|
|
+ env.Append(LINKFLAGS=["-miphoneos-version-min=10.0"])
|
|
|
|
+
|
|
|
|
+ if env["arch"] == "x86" or env["arch"] == "x86_64":
|
|
env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = "10.9"
|
|
env["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = "10.9"
|
|
arch_flag = "i386" if env["arch"] == "x86" else env["arch"]
|
|
arch_flag = "i386" if env["arch"] == "x86" else env["arch"]
|
|
env.Append(
|
|
env.Append(
|
|
CCFLAGS=(
|
|
CCFLAGS=(
|
|
"-arch "
|
|
"-arch "
|
|
+ arch_flag
|
|
+ arch_flag
|
|
- + " -fobjc-arc -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks -fasm-blocks -isysroot $IPHONESDK -mios-simulator-version-min=10.0"
|
|
|
|
|
|
+ + " -fobjc-arc -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks -fasm-blocks -isysroot $IPHONESDK"
|
|
).split()
|
|
).split()
|
|
)
|
|
)
|
|
elif env["arch"] == "arm":
|
|
elif env["arch"] == "arm":
|
|
detect_darwin_sdk_path("iphone", env)
|
|
detect_darwin_sdk_path("iphone", env)
|
|
env.Append(
|
|
env.Append(
|
|
- CCFLAGS='-fobjc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -isysroot $IPHONESDK -fvisibility=hidden -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=10.0 -MMD -MT dependencies'.split()
|
|
|
|
|
|
+ CCFLAGS='-fobjc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -isysroot $IPHONESDK -fvisibility=hidden -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -MMD -MT dependencies'.split()
|
|
)
|
|
)
|
|
elif env["arch"] == "arm64":
|
|
elif env["arch"] == "arm64":
|
|
detect_darwin_sdk_path("iphone", env)
|
|
detect_darwin_sdk_path("iphone", env)
|
|
env.Append(
|
|
env.Append(
|
|
- CCFLAGS="-fobjc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=10.0 -isysroot $IPHONESDK".split()
|
|
|
|
|
|
+ CCFLAGS="-fobjc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -isysroot $IPHONESDK".split()
|
|
)
|
|
)
|
|
env.Append(CPPDEFINES=["NEED_LONG_INT"])
|
|
env.Append(CPPDEFINES=["NEED_LONG_INT"])
|
|
env.Append(CPPDEFINES=["LIBYUV_DISABLE_NEON"])
|
|
env.Append(CPPDEFINES=["LIBYUV_DISABLE_NEON"])
|
|
@@ -148,7 +158,6 @@ def configure(env):
|
|
LINKFLAGS=[
|
|
LINKFLAGS=[
|
|
"-arch",
|
|
"-arch",
|
|
arch_flag,
|
|
arch_flag,
|
|
- "-mios-simulator-version-min=10.0",
|
|
|
|
"-isysroot",
|
|
"-isysroot",
|
|
"$IPHONESDK",
|
|
"$IPHONESDK",
|
|
"-Xlinker",
|
|
"-Xlinker",
|
|
@@ -159,9 +168,9 @@ def configure(env):
|
|
]
|
|
]
|
|
)
|
|
)
|
|
elif env["arch"] == "arm":
|
|
elif env["arch"] == "arm":
|
|
- env.Append(LINKFLAGS=["-arch", "armv7", "-Wl,-dead_strip", "-miphoneos-version-min=10.0"])
|
|
|
|
|
|
+ env.Append(LINKFLAGS=["-arch", "armv7", "-Wl,-dead_strip"])
|
|
if env["arch"] == "arm64":
|
|
if env["arch"] == "arm64":
|
|
- env.Append(LINKFLAGS=["-arch", "arm64", "-Wl,-dead_strip", "-miphoneos-version-min=10.0"])
|
|
|
|
|
|
+ env.Append(LINKFLAGS=["-arch", "arm64", "-Wl,-dead_strip"])
|
|
|
|
|
|
env.Append(
|
|
env.Append(
|
|
LINKFLAGS=[
|
|
LINKFLAGS=[
|