I'm working on Node.js native module which contains C and C++ sources. node-gyp
is used to build the module.
As I want only one warning rises error in C code I use the following lines in binding.gyp
:
"cflags!": [ "-Werror"],
"cflags": [ "-Werror=implicit-function-declaration" ],
This works fine while compiling C code but produces the following warning on each C++ source file:
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
I found this answer - Apply C-specific gcc options to C/C++ mixed library - which solves the same problem when using 'pure' CMake. Unfortunately I didn't found if it is possible and how to add this condition correctly to GYP configuration file - maybe using variables and conditions? Please, let me know if it's solvable. Thanks.