Is the above possible? I want the file included at compile time (and embedded as a string into the program).
XY problems: I have some WebGL vertex/fragment shaders. If possible, I’d prefer to just embed them into the ML source, instead of fetching them at runtime over http.
It’s been a while since I used ppx_blob, but I think that’s the gist of it yes — the ppx might be being executed in the _build directory, so only files that are copied over are visible.
If you have a file that your ppx_blob is going to include you may need to declare it as a preprocessor dependency so dune knows to copy it:
The syntax may have recently changed. I had to use (preprocessor_deps vert.c frag.c) ; otherwise, everything worked flawlessly. Thanks!
Unrelated: I’m still curious where this directory it searches from is; I’m almost certain I calculated the correct location by looking at find _build/ , but I still could not get it to work.