Skip to content

Commit

Permalink
gyp: modify XcodeVersion() to convert "4.2" to "0420" and "10.0" to "…
Browse files Browse the repository at this point in the history
…1000"

Ref: nodejs/node-addon-api#445 (comment)
PR-URL: #1895
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
cclauss authored and rvagg committed Sep 27, 2019
1 parent 36638af commit 1236869
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gyp/pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,9 +1286,9 @@ def XcodeVersion():
version_list = [version, '']
version = version_list[0]
build = version_list[-1]
# Be careful to convert "4.2" to "0420":
version = version.split()[-1].replace('.', '')
version = (version + '0' * (3 - len(version))).zfill(4)
# Be careful to convert "4.2" to "0420" and "10.0" to "1000":
version = format(''.join((version.split()[-1].split('.') + ['0', '0'])[:3]),
'>04s')
if build:
build = build.split()[-1]
XCODE_VERSION_CACHE = (version, build)
Expand Down

0 comments on commit 1236869

Please sign in to comment.