Directly inject c++ code using presets #676
-
Hi Sam: Is there a way to inject c++ code using presets? I tried doing something like this:
The use case is fairly simple. -finstrument-functions causes the compiler to generate enter and exit calls using these method signatures. Ideally I can inject the code in to the generated jni cpp and then the loader will load it from there. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
We can put stuff like that in a separate file like this: https://github.com/bytedeco/javacpp-presets/blob/master/opencv/src/main/resources/org/bytedeco/opencv/include/opencv_adapters.h |
Beta Was this translation helpful? Give feedback.
-
@saudet thanks for getting back to me. Are you saying that the include= will embed the desired code as part of the binary? I was hoping the function I specified would show up in the actual c++ file that's generated. |
Beta Was this translation helpful? Give feedback.
That's technically what the include directive does, we don't need to have something to copy/paste it there.