buck

Structuring Output Folders in Buck


I am working on a project that uses Buck for its build system, and I want to have buck build a set of shaders. It is my understanding that I would use genrule to generate these shaders. The problem that I run into is that I need to specify the location of the shaders output relative to the main binary so that I can run them later. Is there a way to structure this with buck?


Solution

  • It's generally not possible to do that directly. The standard way to access the output a genrule is to use location macro.

    If your binary requires input data to be in a fixed location relative to the binary or current directory, you can work around that limitation by creating symlinks to the output of genrule. To do that you need to add a wrapper script which would create a link to the output of a genrule and then call the main binary.