aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/Configuring-a-build-directory.md
blob: e887e9eee35200d932e622c1ea96cfcf11df7dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Configuring a build directory

Often you want to change the settings of your build after it has been generated. For example you might want to change from a debug build into a release build, set custom compiler flags, change the build options provided in your `meson_options.txt` file and so on.

The main tool for this is the `mesonconf` script. You may also use the `mesongui` graphical application if you want. However this document describes the use of the command line client.

You invoke `mesonconf` by giving it the location of your build dir. If omitted, the current working directory is used instead. Here's a sample output for a simple project.

    Core properties

    Source dir /home/jpakkane/clangdemo/2_address
    Build dir  /home/jpakkane/clangdemo/2_address/buildmeson

    Core options

    type     Build type          debug
    strip    Strip on install    False
    coverage Coverage report     False
    pch      Precompiled headers True
    unity    Unity build         False

    Compiler flags

    cflags []

    Linker flags

    clinkflags []

    Directories

    installprefix Install prefix        /usr/local
    libdir        Library directory     lib
    bindir        Binary directory      bin
    includedir    Header directory      include
    datadir       Data directory        share
    mandir        Man page directory    share/man
    localedir     Locale file directory share/locale

    This project does not have any options

These are all the options available for the current project arranged into related groups. The first column in every field is the name of the option. To set an option you use the `-D` option. For example, changing the installation prefix from `/usr/local` to `/tmp/testroot` you would issue the following command.

    mesonconf -Dprefix=/tmp/testroot

Then you would run your build command (usually `ninja`), which would cause Meson to detect that the build setup has changed and do all the work required to bring your build tree up to date.