Skip to content

Commit

Permalink
added support armv7s for iOS framework
Browse files Browse the repository at this point in the history
for supporting with iOS 6 devices
  • Loading branch information
Alexander Shishkov committed Oct 19, 2012
1 parent 546ec2a commit 2dba13f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ios/build_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

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()
Expand All @@ -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):
Expand Down Expand Up @@ -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)

Expand All @@ -123,4 +125,4 @@ def build_framework(srcroot, dstroot):
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]))

0 comments on commit 2dba13f

Please sign in to comment.