提交 1770ba1d 编写于 作者: V Vadim Pisarevsky

Merge pull request #66 from alekcac/ios-armv7s

added support armv7s for iOS framework; tested on my computer (OSX 10.8, Xcode 4.5)
......@@ -27,10 +27,10 @@ However, OpenCV.framework directory is erased and recreated on each run.
import glob, re, os, os.path, shutil, string, sys
def build_opencv(srcroot, buildroot, target):
def build_opencv(srcroot, buildroot, target, arch):
"builds OpenCV for device or simulator"
builddir = os.path.join(buildroot, target)
builddir = os.path.join(buildroot, target + '-' + arch)
if not os.path.isdir(builddir):
os.makedirs(builddir)
currdir = os.getcwd()
......@@ -52,8 +52,8 @@ def build_opencv(srcroot, buildroot, target):
if os.path.isfile(wlib):
os.remove(wlib)
os.system("xcodebuild -parallelizeTargets -jobs 8 -sdk %s -configuration Release -target ALL_BUILD" % target.lower())
os.system("xcodebuild -sdk %s -configuration Release -target install install" % target.lower())
os.system("xcodebuild -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target ALL_BUILD" % (arch, target.lower()))
os.system("xcodebuild ARCHS=%s -sdk %s -configuration Release -target install install" % (arch, target.lower()))
os.chdir(currdir)
def put_framework_together(srcroot, dstroot):
......@@ -112,8 +112,10 @@ def put_framework_together(srcroot, dstroot):
def build_framework(srcroot, dstroot):
"main function to do all the work"
for target in ["iPhoneOS", "iPhoneSimulator"]:
build_opencv(srcroot, os.path.join(dstroot, "build"), target)
targets = ["iPhoneOS", "iPhoneOS", "iPhoneSimulator"]
archs = ["armv7", "armv7s", "i386"]
for i in range(len(targets)):
build_opencv(srcroot, os.path.join(dstroot, "build"), targets[i], archs[i])
put_framework_together(srcroot, dstroot)
......@@ -123,4 +125,4 @@ if __name__ == "__main__":
print "Usage:\n\t./build_framework.py <outputdir>\n\n"
sys.exit(0)
build_framework(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")), os.path.abspath(sys.argv[1]))
build_framework(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")), os.path.abspath(sys.argv[1]))
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册