tjammer/raylib-ocaml

Compile program with resources?

Closed this issue · 2 comments

Hi there.

Thanks for these cool bindings. I'm finding them useful and am having fun using them.

I have a question about the copying over of assets when running dune build example in your repository. When I try building the examples in your repository, the resources folder get copied into the _build directory with the compiled programs.

I tried making something with these bindings and wanted my application to use some assets (fonts) but the resources didn't get copied over when I tried compiling my application, and Google didn't give much help either so I was wondering if you could offer advice.

Thanks in advance.

The copying is done by dune on build. As far as I know, it copies everything in the dune-project by default.
How does your project tree look like, are the resources inside the dune project?

If all else fails or if your project layout is really different, you can also explicitly tell dune to copy files using https://dune.readthedocs.io/en/stable/dune-files.html#copy-files.
However I don't think it should be needed for the case you describe.

What version of dune are you using? raylib-ocaml is still on dune 2. I don't think the behaviour changed with 3.0, but who knows...

Thanks for the advice @tjammer . I did manage to get pretty much the behaviour I wanted with the Dune docs you linked to, although the different copying behaviour (explicit copy instructions in my case and the no-config behaviour with this library) is still a mystery.

Appreciate the help.