Skip to content

Commit

Permalink
build: fix building with Node.js 6 on macOS
Browse files Browse the repository at this point in the history
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: #265
Reviewed-By: Dmytro Nechai <nechaido@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
  • Loading branch information
aqrln authored and belochub committed Jan 22, 2018
1 parent 0597b58 commit 1b0f343
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
},
'cflags_cc': ['<@(jstp_base_ccflags)'],
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': ['<@(jstp_base_ccflags)']
'OTHER_CPLUSPLUSFLAGS': [
'<@(jstp_base_ccflags)',
'-stdlib=libc++'
]
}
}
]
Expand Down

0 comments on commit 1b0f343

Please sign in to comment.