From 3abed3186f0a62c16bd45b605f61d7e00c23366c Mon Sep 17 00:00:00 2001 From: murgatroid99 <mlumish@google.com> Date: Thu, 7 Jan 2016 17:16:46 -0800 Subject: [PATCH] Compile Node extension with c99 and c++11 --- binding.gyp | 12 +++++++++++- templates/binding.gyp.template | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 75e2f3c8de..747dc57694 100644 --- a/binding.gyp +++ b/binding.gyp @@ -88,6 +88,11 @@ }, 'targets': [ { + 'cflags': [ + '-std=c99', + '-Wall', + '-Werror' + ], 'target_name': 'gpr', 'product_prefix': 'lib', 'type': 'static_library', @@ -145,6 +150,11 @@ ], }, { + 'cflags': [ + '-std=c99', + '-Wall', + '-Werror' + ], 'target_name': 'grpc', 'product_prefix': 'lib', 'type': 'static_library', @@ -316,7 +326,7 @@ "<!(node -e \"require('nan')\")" ], 'cflags': [ - '-std=c++0x', + '-std=c++11', '-Wall', '-pthread', '-g', diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template index be80750eb7..bf01cad34c 100644 --- a/templates/binding.gyp.template +++ b/templates/binding.gyp.template @@ -93,6 +93,11 @@ % for lib in libs: % if lib.name in module.transitive_deps: { + 'cflags': [ + '-std=c99', + '-Wall', + '-Werror' + ], 'target_name': '${lib.name}', 'product_prefix': 'lib', 'type': 'static_library', @@ -121,7 +126,7 @@ "<!(node -e \"require('nan')\")" ], 'cflags': [ - '-std=c++0x', + '-std=c++11', '-Wall', '-pthread', '-g', -- GitLab