dropbox / djinni

A tool for generating cross-language type declarations and interface bindings.
Apache License 2.0
2.88k stars 488 forks source link

JNI headers include themselves #422

Closed sasq64 closed 5 years ago

sasq64 commented 5 years ago

It seems JNI headers by default try to include the corresponding C++ header using just #include "InterfaceName.h", which just ends up including itself. This can be worked-around by adding --jni-include-cpp-prefix $(CPP_OUT_PATH). So is it really the case that this flag is basically mandatory, or am I missing something?

artwyman commented 5 years ago

It is (somewhat confusingly) up to the user to resolve that name collision. What you suggest is one way of doing it. Another (which matches our use case at Dropbox) is to rename the JNI files with a prefix using --ident-jni-file. #411 adds that to the example in README.md