From 1b0f343182146e7797928c5dc5540fcf919704ae Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sat, 22 Jul 2017 15:24:04 +0300 Subject: [PATCH] build: fix building with Node.js 6 on macOS Node.js 6.11.1 bundles npm 3.10.10, which bundles node-gyp 3.4.0. The problem with this version is that it doesn't emit `-stdlib=libc++` as one of clang flags by default, which causes it to use old GCC 4.2 headers instead of clang headers. Because of that, compilation fails with: ../src/parser.cc:10:10: fatal error: 'cstdint' file not found This patch adds the flag to OTHER_CPLUSPLUSFLAGS. It causes no harm when using newer node-gyp because duplicate flags are ignored, but enables building JSTP with vanilla Node.js 6.x on macOS. PR-URL: https://github.com/metarhia/jstp/pull/265 Reviewed-By: Dmytro Nechai Reviewed-By: Mykola Bilochub --- binding.gyp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 27b9b33b..d0daf113 100644 --- a/binding.gyp +++ b/binding.gyp @@ -50,7 +50,10 @@ }, 'cflags_cc': ['<@(jstp_base_ccflags)'], 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': ['<@(jstp_base_ccflags)'] + 'OTHER_CPLUSPLUSFLAGS': [ + '<@(jstp_base_ccflags)', + '-stdlib=libc++' + ] } } ]