1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

doc: Update CMake and meson instructions

This commit is contained in:
Nick Wellnhofer 2025-03-14 03:54:09 +01:00
parent 4135ceea75
commit ee026e160d

View File

@ -23,8 +23,7 @@ This code is released under the MIT License, see the Copyright file.
## Build instructions
libxml2 can be built with GNU Autotools, CMake, meson or several other
build systems in platform-specific subdirectories.
libxml2 can be built with GNU Autotools, CMake or meson.
### Autotools (for POSIX systems like Linux, BSD, macOS)
@ -101,12 +100,13 @@ update your list of installed shared libs.
### CMake (mainly for Windows)
Another option for compiling libxml is using CMake:
Example commands:
cmake -E tar xf libxml2-xxx.tar.gz
cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
cmake --build libxml2-xxx-build
cmake --install libxml2-xxx-build
cmake -E tar xf libxml2-xxx.tar.xz
cmake -S libxml2-xxx -B builddir [options]
cmake --build builddir
ctest --test-dir builddir
cmake --install builddir
Common CMake options include:
@ -122,31 +122,20 @@ directly in various IDEs such as CLion, QtCreator, or Visual Studio.
### Meson
Still somewhat experimental, see
[issue 743](https://gitlab.gnome.org/GNOME/libxml2/-/issues/743).
Example commands:
Libxml can also be built with meson. Without option, simply call
meson setup builddir
meson setup [options] builddir
ninja -C builddir
To add options, see the meson_options.txt file. For example:
meson setup \
-Dprefix=$prefix \
-Dhistory=enabled \
-Dhttp=enabled \
-Dschematron=disabled \
-Dzlib=enabled \
builddir
To install libxml:
meson test -C builddir
ninja -C builddir install
To launch tests:
See the `meson_options.txt` file for options. For example:
meson test -C builddir
-Dprefix=$prefix
-Dhistory=enabled
-Dhttp=enabled
-Dschematron=disabled
-Dzlib=enabled
## Dependencies