Skip to content

Commit

Permalink
[build] Fix build on macOS 10.15 or earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Oct 15, 2023
1 parent bdd2b2c commit 3af3375
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@
'cflags': ['-std=c99'],
'conditions': [
["OS=='mac'", {
'variables': {
'clang_version':
'<!(cc -v 2>&1 | perl -ne \'print $1 if /clang version ([0-9]+(\.[0-9]+){2,})/\')'
},
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CFLAGS': ['-arch x86_64', '-arch arm64'],
'OTHER_LDFLAGS': ['-arch x86_64', '-arch arm64']
}
'MACOSX_DEPLOYMENT_TARGET': '10.7'
},
'conditions': [
# Use Perl v-strings to compare versions.
['clang_version and <!(perl -e \'print <(clang_version) cmp 12.0.0\')==1', {
'xcode_settings': {
'OTHER_CFLAGS': ['-arch arm64'],
'OTHER_LDFLAGS': ['-arch arm64']
}
}]
]
}]
]
}
Expand Down

0 comments on commit 3af3375

Please sign in to comment.