dropbox / djinni

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

Generated file with prefix on include headers #394

Closed paulocoutinhox closed 6 years ago

paulocoutinhox commented 6 years ago

Hi,

Recently i pass by a problem on include paths. Two files with the same name. One i control because if from my project, but the other is from djinni. See an example:

https://github.com/ezored/dependency-string-helper/blob/master/build/djinni/jni-output/ezored/helpers/EZRStringHelper.hpp

And

https://github.com/ezored/dependency-string-helper/blob/master/build/djinni/jni-output/ezored/helpers/EZRStringHelper.cpp

And

https://github.com/ezored/dependency-string-helper/blob/master/build/djinni/objc-output/ezored/helpers/EZRStringHelper%2BPrivate.h

Every file has:

#include "StringHelper.hpp"

That is the header generated by djinni.

I want suggest an option in cpp or individual (cpp, jni, objc), that add a prefix to this include path. Example:

#include "${cpp_prefix}StringHelper.hpp"

It give us more control about include paths.

What team think about? Possible?

artwyman commented 6 years ago

I think you might be looking for the cpp-include-prefix cmd-line argument, which you can see here: https://github.com/dropbox/djinni/blob/master/src/source/Main.scala#L130

There are also other prefix args you can find in that same source file if I pointed to the wrong one. You can also use the ident-cpp-file argument to change the C++ file names to not conflict.

paulocoutinhox commented 6 years ago

Arrrghhh. Djinni has everything!!! :p

Thanks man.