From a1ffdbcd50e3e5b276b9e961bd5496402488c31c Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Sun, 2 Feb 2025 07:39:22 +0100 Subject: [PATCH] Documentation for format compile time configuration (#1262) --- INSTALL.md | 24 ++++++++++++++++++++++++ bindings/c/tag_c.cpp | 1 + 2 files changed, 25 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index e238cde4..77c9d7a9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -49,6 +49,30 @@ for both versions. The installed files will then include bin/taglib-2-config, include/taglib-2, cmake/taglib-2, pkgconfig/taglib-2.pc, pkgconfig/taglib_c-2.pc and the libraries have a suffix "-2". +### Compile Time Configuration of Supported Formats + +To reduce the size of the library, it is possible to switch off supported file +formats. By default, all formats are enabled. Support for MPEG files (MP3, AAC) +and ID3 tags cannot be disabled. The following CMake options are available: + +| Option | Description | +|-------------------------|----------------------------------------------------| +| `WITH_APE` | Build with APE, MPC, WavPack (default ON) | +| `WITH_ASF` | Build with ASF (default ON) | +| `WITH_DSF` | Build with DSF (default ON) | +| `WITH_MOD` | Build with Tracker modules (default ON) | +| `WITH_MP4` | Build with MP4 (default ON) | +| `WITH_RIFF` | Build with AIFF, RIFF, WAV (default ON) | +| `WITH_SHORTEN` | Build with Shorten (default ON) | +| `WITH_TRUEAUDIO` | Build with TrueAudio (default ON) | +| `WITH_VORBIS` | Build with Vorbis, FLAC, Ogg, Opus (default ON) | + +Note that disabling formats will remove exported symbols from the library and +thus break binary compatibility. These options should therefore only be used +if the library is built specifically for a certain project. The public header +files still contain the full API, if you use TagLib with a reduced set of +formats, you can include taglib_config.h and use its definitions (prefixed with +`TAGLIB_`, e.g. `TAGLIB_WITH_APE`), as it is done in examples/framelist.cpp. ## Dependencies diff --git a/bindings/c/tag_c.cpp b/bindings/c/tag_c.cpp index c5c73486..c2d18f0a 100644 --- a/bindings/c/tag_c.cpp +++ b/bindings/c/tag_c.cpp @@ -29,6 +29,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif + #include "taglib_config.h" #include "tstringlist.h" #include "tbytevectorstream.h"