Add meson build system

Meson is a build system somewhat like cmake, but without all of the
rough edges. It supports many OSes, including all of the major ones, and
a large number of C++ compilers.

My interest isn't really in convincing people to use meson as the
default here, but meson provides a subproject mechanism that can fetch
external projects and build them along with the main project in a single
configure/compile invocation. This is extremely useful for platforms
that lack a (competent) package manager.

As far as I know the meson build does everything the cmake build does,
with one exception: generate the cmake config/version files. meson can
generate these files, but only in simple cases, and not when using
export targets like tinyxml2 does.
This commit is contained in:
Dylan Baker
2020-10-08 11:40:05 -07:00
parent 1aeb57d26b
commit c509d569c0
4 changed files with 166 additions and 3 deletions

View File

@@ -265,9 +265,31 @@ And additionally a test file:
* xmltest.cpp
Simply compile and run. There is a visual studio 2019 project included, a simple Makefile,
an Xcode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you.
The top of tinyxml.h even has a simple g++ command line if you are using Unix/Linux/BSD and
don't want to use a build system.
an Xcode project, a Code::Blocks project, a cmake CMakeLists.txt, and a meson.build are
included to help you. The top of tinyxml.h even has a simple g++ command line if you are
using Unix/Linux/BSD and don't want to use a build system.
Using as a Meson Subproject
---------------------------
Create a wrap file such as:
```ini
[wrap-git]
url = https://github.com/leethomason/tinyxml2.git
revision = 8.0.1 # this can be any commit-ish (tag, sha) or the special value `head`
```
or, if you prefer to not use git
```ini
[wrap-file]
directory = tinyxml2-8.0.1 # this is the name of the directory after de-compressing
source_url = https://github.com/leethomason/tinyxml2/archive/8.0.1.tar.gz
source_hash = sha256sum of compressed sources
```
in your project's `subprojects/` folder, and follow the meson documentation
for using fallbacks.
Building TinyXML-2 - Using vcpkg
--------------------------------