Skip to content

Commit 6fe1bbd

Browse files
authored
Add -nostdinc++ and include the C++10 headers
When using the sysroot
1 parent e02c718 commit 6fe1bbd

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

binding.gyp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,32 @@
9393
['OS=="linux"', {
9494
'variables': {
9595
'sysroot%': '<!(node -p "process.env.SYSROOT_PATH || \'\'")',
96+
'target_arch%': '<!(node -p "process.env.npm_config_arch || process.arch")',
9697
},
9798
'conditions': [
9899
['sysroot!=""', {
99-
'cflags': ['--sysroot=<(sysroot)'],
100-
'ldflags': ['--sysroot=<(sysroot)'],
100+
'conditions': [
101+
['target_arch=="x64"', {
102+
'cflags': [
103+
'--sysroot=<(sysroot)',
104+
'-nostdinc++',
105+
'-isystem<(sysroot)/usr/include/c++/10',
106+
'-isystem<(sysroot)/usr/include/x86_64-linux-gnu/c++/10',
107+
'-isystem<(sysroot)/usr/include/c++/10/backward'
108+
],
109+
'ldflags': ['--sysroot=<(sysroot)'],
110+
}],
111+
['target_arch=="arm64"', {
112+
'cflags': [
113+
'--sysroot=<(sysroot)',
114+
'-nostdinc++',
115+
'-isystem<(sysroot)/usr/include/c++/10',
116+
'-isystem<(sysroot)/usr/include/aarch64-linux-gnu/c++/10',
117+
'-isystem<(sysroot)/usr/include/c++/10/backward'
118+
],
119+
'ldflags': ['--sysroot=<(sysroot)'],
120+
}]
121+
]
101122
}]
102123
]
103124
}]

0 commit comments

Comments
 (0)