X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flibchdr%2Fdeps%2Fzstd-1.5.5%2Fbuild%2Fsingle_file_libs%2FREADME.md;fp=deps%2Flibchdr%2Fdeps%2Fzstd-1.5.5%2Fbuild%2Fsingle_file_libs%2FREADME.md;h=64c973a68d6c857b010a0672376c782399cb310b;hb=648db22b0750712da893c306efcc8e4b2d3a4e3c;hp=0000000000000000000000000000000000000000;hpb=e2fb1389dc12376acb84e4993ed3b08760257252;p=pcsx_rearmed.git diff --git a/deps/libchdr/deps/zstd-1.5.5/build/single_file_libs/README.md b/deps/libchdr/deps/zstd-1.5.5/build/single_file_libs/README.md new file mode 100644 index 00000000..64c973a6 --- /dev/null +++ b/deps/libchdr/deps/zstd-1.5.5/build/single_file_libs/README.md @@ -0,0 +1,33 @@ +# Single File Zstandard Libraries + +The script `combine.sh` creates an _amalgamated_ source file that can be used with or without `zstd.h`. This isn't a _header-only_ file but it does offer a similar level of simplicity when integrating into a project. + +All it now takes to support Zstd in your own projects is the addition of a single file, two if using the header, with no configuration or further build steps. + +Decompressor +------------ + +This is the most common use case. The decompression library is small, adding, for example, 26kB to an Emscripten compiled WebAssembly project. Native implementations add a little more, 40-70kB depending on the compiler and platform. + +Create `zstddeclib.c` from the Zstd source using: +``` +cd zstd/build/single_file_libs +python3 combine.py -r ../../lib -x legacy/zstd_legacy.h -o zstddeclib.c zstddeclib-in.c +``` +Then add the resulting file to your project (see the [example files](examples)). + +`create_single_file_decoder.sh` will run the above script, creating the file `zstddeclib.c` (`build_decoder_test.sh` will also create `zstddeclib.c`, then compile and test the result). + +Full Library +------------ + +The same tool can amalgamate the entire Zstd library for ease of adding both compression and decompression to a project. The [roundtrip example](examples/roundtrip.c) uses the original `zstd.h` with the remaining source files combined into `zstd.c` (currently just over 1.2MB) created from `zstd-in.c`. As with the standalone decoder the most useful compile flags have already been rolled-in and the resulting file can be added to a project as-is. + +Create `zstd.c` from the Zstd source using: +``` +cd zstd/build/single_file_libs +python3 combine.py -r ../../lib -x legacy/zstd_legacy.h -k zstd.h -o zstd.c zstd-in.c +``` +It's possible to create a compressor-only library but since the decompressor is so small in comparison this doesn't bring much of a gain (but for the curious, simply remove the files in the _decompress_ section at the end of `zstd-in.c`). + +`create_single_file_library.sh` will run the script to create `zstd.c` (`build_library_test.sh` will also create `zstd.c`, then compile and test the result).