From 3c5a6be835551afabebb14b00b8a1beb820cbddd Mon Sep 17 00:00:00 2001 From: Andrew Mroczkowski Date: Wed, 26 Sep 2018 17:20:37 -0400 Subject: [PATCH] Fix Xcode version parsing error (affects bitcode generation) The regex was only parsing for a single digit in the major version, causing Xcode 10 to be treated as version "1". Other parts of the script only turn on bitcode generation if the Xcode version is > 7. --- platforms/ios/build_framework.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index d624e08d90..f546c6af5d 100755 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -39,10 +39,11 @@ def execute(cmd, cwd = None): def getXCodeMajor(): ret = check_output(["xcodebuild", "-version"]) - m = re.match(r'XCode\s+(\d)\..*', ret, flags=re.IGNORECASE) + m = re.match(r'Xcode\s+(\d+)\..*', ret, flags=re.IGNORECASE) if m: return int(m.group(1)) - return 0 + else: + raise Exception("Failed to parse Xcode version") class Builder: def __init__(self, opencv, contrib, dynamic, bitcodedisabled, exclude, targets):