In the llvm-c/Target.h
header there are six macros which declare functions for target initialization. These are ran for each target to generate a set of APIs exposed to LLVM-C.
Javacpp is currently not properly read though this (probably because the llvm/Config/Targets.def
file is created during build generation.
Fix
I'm not sure how we want to go about adding these APIs as they should only be available if the target is enabled. With the current build setup, that would be one target, but a different one for each platform we build the binaries for.
Creating a stub file (similar to LLVM full optimization #869) in the resources directory and add it to the preset for ALL targets
This solution means that the initialization API for every target will be "available" regardless of which target the user's binary has enabled. This is probably not wanted behavior because calling into a function which doesn't actually exist will crash the JVM.
Parse the llvm-c/Target.h
file after build generator step, assuming the Javacpp parser is able to perform macro expansion.
This requires the parser to go over the files after the build has been generated.
I have created an example showing how this could be done if we go with option 1 here
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4