To do an out-of-source build in Meson:
cd /path/to/source/
mkdir ../builddir
Then:
cd /path/to/source/
meson ../builddir
cd ../builddir
ninja
Is it possible to do anything like this (from builddir
):
meson --pathToSource ../source // pseudocode
ninja
I.e. avoid jumping from the source to the build directory and back.
For CMake, this is the default.
Once you've run
meson
to create build directory (whichmeson
can create automatically), there is no need to run it everytime you change meson.build. When you runninja
, meson can regenerate build configurations itself depending on the changes in the sources.To run
ninja
in other places than build directory, you can you-C
option (fromninja -h
):Given your example, it will be: