From 70d86a9205d8e2629b827ebd96c4bb20ba3faf43 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 31 Jan 2017 20:48:54 +0200 Subject: [PATCH] build: compile in ISO C++11 mode * Use `cflags_cc` instead of `cflags`. * By default `node-gyp` uses `-std=gnu++0x`. This commit modifies `cflags_cc` to use `-std=c++11`. --- binding.gyp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/binding.gyp b/binding.gyp index d4fd2190..29671103 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,8 +1,13 @@ { 'variables': { - 'jstp_base_cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter'], - 'jstp_debug_cflags': ['-g', '-O0'], - 'jstp_release_cflags': ['-O3'] + 'jstp_base_ccflags': [ + '-Wall', + '-Wextra', + '-Wno-unused-parameter', + '-std=c++11' + ], + 'jstp_debug_ccflags': ['-g', '-O0'], + 'jstp_release_ccflags': ['-O3'] }, 'targets': [ { @@ -16,21 +21,21 @@ ], 'configurations': { 'Debug': { - 'cflags': ['<@(jstp_debug_cflags)'], + 'cflags_cc': ['<@(jstp_debug_ccflags)'], 'xcode_settings': { - 'OTHER_CFLAGS': ['<@(jstp_debug_cflags)'] + 'OTHER_CPLUSPLUSFLAGS': ['<@(jstp_debug_ccflags)'] } }, 'Release': { - 'cflags': ['<@(jstp_release_cflags)'], + 'cflags_cc': ['<@(jstp_release_ccflags)'], 'xcode_settings': { - 'OTHER_CFLAGS': ['<@(jstp_release_cflags)'] + 'OTHER_CPLUSPLUSFLAGS': ['<@(jstp_release_ccflags)'] } } }, - 'cflags': ['<@(jstp_base_cflags)'], + 'cflags_cc': ['<@(jstp_base_ccflags)'], 'xcode_settings': { - 'OTHER_CFLAGS': ['<@(jstp_base_cflags)'] + 'OTHER_CPLUSPLUSFLAGS': ['<@(jstp_base_ccflags)'] } } ]