From f1ce2a5ac2ba3266d525544445366fae538d7194 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 26 Sep 2023 16:14:21 -0700 Subject: Node.js: provide reasonable default paths for macOS. --- src/nodejs/unit-http/binding_pub.gyp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/nodejs/unit-http/binding_pub.gyp b/src/nodejs/unit-http/binding_pub.gyp index 3c39933a..3dadf4a5 100644 --- a/src/nodejs/unit-http/binding_pub.gyp +++ b/src/nodejs/unit-http/binding_pub.gyp @@ -7,9 +7,28 @@ ['OS=="mac"', { 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' - } - }] - ], + }, + 'conditions': [ + [ 'target_arch=="arm64"', { + 'include_dirs': [ + '/opt/homebrew/include' + ], + 'libraries' : [ + '-L/opt/homebrew/lib', + '-lunit' + ], + }], + ['target_arch=="x64"', { + 'include_dirs': [ + '/usr/local/include', + ], + 'libraries' : [ + '-L/usr/local/lib', + '-lunit' + ], + }] + ]} + ]], 'sources': ["unit.cpp", "addon.cpp"], 'libraries': ["-lunit"] }] -- cgit