USRESOURCECOMPILER3(1)

πŸ“¦
version 3.8.9 Β· 2 versions
, in fedora 44

πŸ‘‘ USRESOURCECOMPILER3 β€” the manual page, bestie edition πŸ’…

okay so this is usResourceCompiler3(1), which lives in the C++ Micro Services manual section. It's the CppMicroServices Resource Compiler β€” the little tool that stuffs your resources into a zip and yeets it into your bundle binary. ✨

Also, if you want the big-picture lore, there's a Framework section that gives you the high-level description. Go read it, it's giving ✨context✨.


πŸ“– COMMAND-LINE REFERENCE

These are literally all the options usResourceCompiler3 f understands. No gatekeeping, here's the whole list: 🫢

  • --help, -h β€” prints the usage info and dips out. that's it, that's the whole job. ✨
  • --verbose, -V β€” run in verbose mode. she will tell you everything. πŸ—£οΈ
  • --bundle-name, -n β€” the bundle name, exactly like it's specified in the US_BUNDLE_NAME compile definition. don't freestyle this one. πŸ’…
  • --compression-level, -c β€” the compression level used for zip. valid values go from 0 to 9. default is 6. πŸ‘‘
  • --out-file, -o β€” path to the output zip file. if that file already exists, bestie, it will be overwritten. if you don't pass this option, a temporary zip file gets created instead. πŸŽ€
  • --res-add, -r β€” path to a resource file, relative to the current working directory. 🌸
  • --zip-add, -z β€” path to a file containing a zip archive, which gets merged into the output zip file. πŸ¦‹
  • --manifest-add, -m β€” path to the bundle's manifest file. if you specify multiple --manifest-add options, all the manifest files get concatenated into one. 😌
  • --bundle-file, -b β€” path to the bundle binary. the resources zip file gets appended to this binary. πŸ”₯
Note: these are important, do not skip, i am not joking πŸ™ˆ 1. Only the options --res-add, --zip-add and --manifest-add can be specified multiple times. the others? one and done. 2. If the option --manifest-add or --res-add is specified, then the option --bundle-name must be provided. no bundle name, no deal. πŸ’€ 3. At-least one of --bundle-file or --out-file options must be provided. you have to pick at least one, periodt.
Hint: 🧚 If you're using CMake, pls consider using the provided usFunctionEmbedResources CMake macro (it lives in the command:usFunctionEmbedResources section, iykyk). It handles invoking the usResourceCompiler3 executable and sets up the correct file dependencies for you, so you don't have to think about it. iconic behaviour honestly. 🌈 Otherwise β€” meaning no CMake β€” you also need to make sure that the set of static bundles linked into a shared bundle or executable is also in the input file list of your usResourceCompiler3 call for that shared bundle or executable. yes that's a mouthful. yes it matters. 😭 Here's a full example that creates a bundle and embeds resource data, because we love a complete demo: set(bundle_name "org_me_mybundle") set(srcs mybundle.cpp) usFunctionGenerateBundleInit(TARGET mybundle OUT srcs) usFunctionGetResourceSource(TARGET mybundle OUT srcs) add_library(mybundle ${srcs}) target_link_libraries(mybundle CppMicroServices) set_property(TARGET mybundle APPEND PROPERTY COMPILE_DEFINITIONS US_BUNDLE_NAME=${bundle_name}) set_property(TARGET mybundle PROPERTY US_BUNDLE_NAME ${bundle_name}) usFunctionEmbedResources(TARGET mybundle FILES hello.txt )

If you are not using CMake, no stress β€” you can run the resource compiler from the command line yourself. main character energy. πŸ’œ


πŸ“ EXAMPLE USAGE

1. Construct a zip blob with the contents mybundle/manifest.json, merge the contents of the zip file filetomerge.zip into it, and write the resulting blob into Example.zip:

usResourceCompiler3 --compression-level 9 --verbose --bundle-name mybundle --out-file Example.zip --manifest-add manifest.json --zip-add filetomerge.zip

2. Construct a zip blob with the contents mybundle/manifest.json, merge the contents of the zip file archivetomerge.zip into it, and append the resulting zip blob to mybundle.dylib:

usResourceCompiler3 -V -n mybundle -b mybundle.dylib -m manifest.json -z archivetomerge.zip

3. Append the contents of archivetoembed.zip to mybundle.dll:

usResourceCompiler3.exe -b mybundle.dll -z archivetoembed.zip

4. Construct a zip blob with the contents of manifest_part1.json and auto_generated_manifest.json concatenated into mybundle/manifest.json, and embed it into mybundle.dll:

usResourceCompiler3 -n mybundle -b mybundle.dll -m manifest_part1.json -m auto_generated_manifest.json

πŸ’– Author

CppMicroServices Team 🫢

2017-2023, CppMicroServices Contributors


okay that's the whole page, bestie!! this was version 3.8.9, dated Feb 02, 2026, and it's the USRESOURCECOMPILER3(1) page from the C++ Micro Services manual. slay, go compile something. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from