(C/C++) Embed file assets into binaries automaticly with VisualStudio build tasks
Sometimes developing apps, we need to reduce the build to a single exe containing handful of asset files, in this scenario, you can use the great library
PhysFS that will let you zip everithing and load those files on runtime. We can further automatize this process by adding a VisualStudio Pre-build event that zips a custom folder, but also packs it on the final executable.
To start, locate your project folder and add a
www asset directory and
vendor directory, where we will put neccessary files
7z.exe, 7z.dll, objcopy.exe, www.bat 7zip will pack the files on a generated "resources.zip" this can be edited or even removed, it may even include the usage of zip password as PhysFS supports it. Objcopy, its part of some VS distributions and generated a .lib static library with the asset, exporting its start and end address.
/vendor/www.bat (notice you w