Skip to content

Commit

Permalink
mac: Fix support with XCode 10
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Dec 16, 2018
1 parent cc00a54 commit d811446
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ notifications:

language: node_js
node_js:
- "8"
- "10"
os:
- osx
- linux
osx_image: xcode8.3
osx_image: xcode10.1
dist: trusty
sudo: required

Expand Down
2 changes: 2 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,8 @@ config("default_warnings") {

# TODO(hans): https://crbug.com/637306
"-Wno-address-of-packed-member",

"-Wno-unused-lambda-capture",
]
}
}
Expand Down
34 changes: 27 additions & 7 deletions build/config/mac/sdk_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,41 @@
# found in the LICENSE file.

import argparse
import doctest
import itertools
import os
import subprocess
import sys

# This script prints information about the build system, the operating
# system and the iOS or Mac SDK (depending on the platform "iphonesimulator",
# "iphoneos" or "macosx" generally).
#
# In the GYP build, this is done inside GYP itself based on the SDKROOT
# variable.

def SplitVersion(version):
"""Splits the Xcode version to 3 values.
>>> list(SplitVersion('8.2.1.1'))
['8', '2', '1']
>>> list(SplitVersion('9.3'))
['9', '3', '0']
>>> list(SplitVersion('10.0'))
['10', '0', '0']
"""
version = version.split('.')
return itertools.islice(itertools.chain(version, itertools.repeat('0')), 0, 3)

def FormatVersion(version):
"""Converts Xcode version to a format required for Info.plist."""
version = version.replace('.', '')
version = version + '0' * (3 - len(version))
return version.zfill(4)
"""Converts Xcode version to a format required for DTXcode in Info.plist
>>> FormatVersion('8.2.1')
'0821'
>>> FormatVersion('9.3')
'0930'
>>> FormatVersion('10.0')
'1000'
"""
major, minor, patch = SplitVersion(version)
return ('%2s%s%s' % (major, minor, patch)).replace(' ', '0')

def FillXcodeVersion(settings):
"""Fills the Xcode version and build number into |settings|."""
Expand Down Expand Up @@ -53,6 +71,8 @@ def FillSDKPathAndVersion(settings, platform, xcode_version):


if __name__ == '__main__':
doctest.testmod()

parser = argparse.ArgumentParser()
parser.add_argument("--developer_dir", required=False)
args, unknownargs = parser.parse_known_args()
Expand Down

0 comments on commit d811446

Please sign in to comment.