From 3af337566915e9b306c671671939c88fb5ee0ee7 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 15 Oct 2023 16:48:47 +0200 Subject: [PATCH] [build] Fix build on macOS 10.15 or earlier --- binding.gyp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/binding.gyp b/binding.gyp index 1e97c0c..168b58a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -6,11 +6,22 @@ 'cflags': ['-std=c99'], 'conditions': [ ["OS=='mac'", { + 'variables': { + 'clang_version': + '&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