Hey!

@Jimb Esser
The answer to the simple question you pose would only be useful if I were to
1. package the code which is sensitive to the -DDEBUG flag in a separate 
module (call it c-code) with its own package.json and everything, built in 
release mode, and
2. place the C++ bindings in a second module (call it cpp-code) which 
depends on c-code and is being built in debug mode.

This kind of setup feels unusual to me, because c-code would have 
absolutely no JS bindings, so the main.js or index.js or whatever I specify 
as the entry point of the package would do absolutely nothing. 
Nevertheless, if this is the structure things need to have for me to be 
able to test the native side of my C++ bindings, then so be it, and please, 
someone, let us know if it's possible to build a package in debug mode 
without building its entire dependency tree in debug mode as well.

The current setup is such that the C code which is sensitive to -DDEBUG is 
in the same package as the C++ code which provides node bindings to the C 
code. My original motivation for looking into debug mode was that I wanted 
to add instrumentation to my C++ bindings which compile conditionally on 
the presence of -DDEBUG or -D_DEBUG so that I may write tests in JS which 
would test the native side of my package. However, it looks like I'll have 
to come up with my own testing workflow because there's absolutely no 
documentation anywhere about how to affect node's debug mode CFLAGS and/or 
DEFINES via binding.gyp and/or config.gypi, and it also sounds like debug 
mode is a recipe for instability.

So, if somebody can please point me to some documentation about how to 
prevent node-gyp from passing -DDEBUG to the compiler when building in 
debug mode, then I would greatly appreciate that, because I would like to 
draw my own conclusions about the usefulness of debug mode given that my 
package has only one native dependency (ffi). In the meantime, I'll try to 
come up with an alternative workflow for debugging and testing my native 
code.

Thanks for all your help so far!



Gabriel

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/c06df6b2-d89e-4be9-9574-b54347d38735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to