Search code examples
premake

How do I have premake run an external tool only if the target is out of date


As part of my build process, I have an archive that I need to extract. I can use prebuildcommands to always extract it, but that is repetitive and will slow the build.

How do say "run this command only if the extracted directory does not exist".

It would be good to also extract the file if the archive is new than the directory, but I'm less concerned about that, as I do not expect the archive to change often.

Edit: I have an external requirement to use Premake 4.


Solution

  • It looks like the documentation is a little incomplete, but (using Premake5) maybe something like this?

    buildcommands { "cmd to unarchive the file" }
    buildinputs { "name of archive" }
    buildoutputs { "name of a file from the archive" }