aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Build-options.md30
-rw-r--r--docs/markdown/Configuration.md8
-rw-r--r--docs/markdown/Dependencies.md169
-rw-r--r--docs/markdown/Gnome-module.md2
-rw-r--r--docs/markdown/Reference-manual.md14
-rw-r--r--docs/markdown/Release-notes-for-0.44.0.md6
-rw-r--r--docs/markdown/Release-notes-for-0.47.0.md6
-rw-r--r--docs/markdown/snippets/configure_file_encoding.md12
-rw-r--r--docs/markdown/snippets/gdbus_codegen_options.md14
9 files changed, 199 insertions, 62 deletions
diff --git a/docs/markdown/Build-options.md b/docs/markdown/Build-options.md
index 9ccdf83..ec4a3bb 100644
--- a/docs/markdown/Build-options.md
+++ b/docs/markdown/Build-options.md
@@ -21,6 +21,8 @@ option('free_array_opt', type : 'array', value : ['one', 'two'])
option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two'])
```
+## Build option types
+
All types allow a `description` value to be set describing the option,
if no option is set then the name of the option will be used instead.
@@ -40,7 +42,7 @@ A combo allows any one of the values in the `choices` parameter to be
selected. If no default value is set then the first value will be the
default.
-## Integers
+### Integers
An integer option contains a single integer with optional upper and
lower values that are specified with the `min` and `max` keyword
@@ -135,3 +137,29 @@ project which also has an option called `some_option`, then calling
`get_option` returns the value of the superproject. If the value of
`yield` is `false`, `get_option` returns the value of the subproject's
option.
+
+
+## Built-in build options
+
+There are a number of built-in options. To get the current list execute `meson
+configure` in the build directory.
+
+### Visual Studio
+
+#### Startup project
+
+The backend\_startup\_project option can be set to define the default project
+that will be executed with the "Start debugging F5" action in visual studio.
+It should be the same name as an executable target name.
+
+```meson
+project('my_project', 'c', default_options: ['backend_startup_project=my_exe'])
+executable('my_exe', ...)
+```
+
+### Ninja
+
+#### Max links
+
+The backend\_max\_links can be set to limit the number of processes that ninja
+will use to link.
diff --git a/docs/markdown/Configuration.md b/docs/markdown/Configuration.md
index 89f423c..8b79bc6 100644
--- a/docs/markdown/Configuration.md
+++ b/docs/markdown/Configuration.md
@@ -113,6 +113,14 @@ Will produce:
#define BAR
```
+## Dealing with file encodings
+
+The default meson file encoding to configure files is utf-8. If you need to
+configure a file that is not utf-8 encoded the encoding keyword will allow
+you to specify which file encoding to use. It is however strongly advised to
+convert your non utf-8 file to utf-8 whenever possible. Supported file
+encodings are those of python3, see [standard-encodings](https://docs.python.org/3/library/codecs.html#standard-encodings).
+
# A full example
Generating and using a configuration file requires the following steps:
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index d2b5e0a..3e4e5ad 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -111,6 +111,38 @@ of all the work behind the scenes to make this work.
# Dependencies with custom lookup functionality
+Some dependencies have specific detection logic.
+
+Generic dependency names are case-sensitive<sup>[1](#footnote1)</sup>, but these
+dependency names are matched case-insensitively. The recommended style is to
+write them in all lower-case.
+
+In some cases, more than one detection method exists, and the `method` keyword
+may be used to select a detection method to use. The `auto` method uses any
+checking mechanisms in whatever order meson thinks is best.
+
+e.g. libwmf and CUPS provide both pkg-config and config-tool support. You can
+force one or another via the `method` keyword:
+
+```meson
+cups_dep = dependency('cups', method : 'pkg-config')
+wmf_dep = dependency('libwmf', method : 'config-tool')
+```
+
+## Dependencies using config tools
+
+[CUPS](#cups), [LLVM](#llvm), [pcap](#pcap), [WxWidgets](#wxwidgets),
+[libwmf](#libwmf), and GnuStep either do not provide pkg-config modules or
+additionally can be detected via a config tool (cups-config, llvm-config,
+etc). Meson has native support for these tools, and they can be found like other
+dependencies:
+
+```meson
+pcap_dep = dependency('pcap', version : '>=1.0')
+cups_dep = dependency('cups', version : '>=1.4')
+llvm_dep = dependency('llvm', version : '>=4.0')
+```
+
## AppleFrameworks
Use the `modules` keyword to list frameworks required, e.g.
@@ -119,6 +151,8 @@ Use the `modules` keyword to list frameworks required, e.g.
dep = find_dep('appleframeworks', modules : 'foundation')
```
+These dependencies can never be found for non-OSX hosts.
+
## Boost
Boost is not a single dependency but rather a group of different
@@ -148,10 +182,16 @@ environment variables.
You can set the argument `threading` to `single` to use boost libraries that
have been compiled for single-threaded use instead.
+## CUPS
+
+`method` may be `auto`, `config-tool`, `pkg-config` or `extraframework`.
+
## GL
This finds the OpenGL library in a way appropriate to the platform.
+`method` may be `auto`, `pkg-config` or `system`.
+
## GTest and GMock
GTest and GMock come as sources that must be compiled as part of your
@@ -167,8 +207,46 @@ gtest_dep = dependency('gtest', main : true, required : false)
e = executable('testprog', 'test.cc', dependencies : gtest_dep)
test('gtest test', e)
```
+
+## libwmf
+
+*(added 0.44.0)*
+
+`method` may be `auto`, `config-tool` or `pkg-config`.
+
+## LLVM
+
+Meson has native support for LLVM going back to version LLVM version 3.5.
+It supports a few additional features compared to other config-tool based
+dependencies.
+
+As of 0.44.0 Meson supports the `static` keyword argument for LLVM. Before this
+LLVM >= 3.9 would always dynamically link, while older versions would
+statically link, due to a quirk in `llvm-config`.
+
+### Modules, a.k.a. Components
+
+Meson wraps LLVM's concept of components in it's own modules concept.
+When you need specific components you add them as modules as meson will do the
+right thing:
+
+```meson
+llvm_dep = dependency('llvm', version : '>= 4.0', modules : ['amdgpu'])
+```
+
+As of 0.44.0 it can also take optional modules (these will affect the arguments
+generated for a static link):
+
+```meson
+llvm_dep = dependency(
+ 'llvm', version : '>= 4.0', modules : ['amdgpu'], optional_modules : ['inteljitevents'],
+)
+```
+
## MPI
+*(added 0.42.0)*
+
MPI is supported for C, C++ and Fortran. Because dependencies are
language-specific, you must specify the requested language using the
`language` keyword argument, i.e.,
@@ -185,11 +263,33 @@ environment variables `MPICC`, `MPICXX`, `MPIFC`, `MPIF90`, or
## OpenMP
+*(added 0.46.0)*
+
This dependency selects the appropriate compiler flags and/or libraries to use
for OpenMP support.
The `language` keyword may used.
+## pcap
+
+*(added 0.42.0)*
+
+`method` may be `auto`, `config-tool` or `pkg-config`.
+
+## Python3
+
+Python3 is handled specially by meson:
+1. Meson tries to use `pkg-config`.
+1. If `pkg-config` fails meson uses a fallback:
+ - On Windows the fallback is the current `python3` interpreter.
+ - On OSX the fallback is a framework dependency from `/Library/Frameworks`.
+
+Note that `python3` found by this dependency might differ from the one used in
+`python3` module because modules uses the current interpreter, but dependency tries
+`pkg-config` first.
+
+`method` may be `auto`, `extraframework`, `pkg-config` or `sysconfig`
+
## Qt4 & Qt5
Meson has native Qt support. Its usage is best demonstrated with an
@@ -229,11 +329,15 @@ include path of the given module(s) to the compiler flags. (since v0.47.0)
**Note** using private headers in your project is a bad idea, do so at your own
risk.
+`method` may be `auto`, `pkgconfig` or `qmake`.
+
## SDL2
SDL2 can be located using `pkg-confg`, the `sdl2-config` config tool, or as an
OSX framework.
+`method` may be `auto`, `config-tool`, `extraframework` or `pkg-config`.
+
## Threads
This dependency selects the appropriate compiler flags and/or libraries to use
@@ -248,27 +352,11 @@ and avoids trying to link with it's non-PIC static libs.
## Vulkan
-Vulkan can be located using `pkg-config`, or the `VULKAN_SDK` environment variable.
-
-## Dependencies using config tools
-
-CUPS, LLVM, PCAP, [WxWidgets](#wxwidgets), libwmf, and GnuStep either do not
-provide pkg-config modules or additionally can be detected via a config tool
-(cups-config, llvm-config, etc). Meson has native support for these tools, and
-they can be found like other dependencies:
+*(added 0.42.0)*
-```meson
-pcap_dep = dependency('pcap', version : '>=1.0')
-cups_dep = dependency('cups', version : '>=1.4')
-llvm_dep = dependency('llvm', version : '>=4.0')
-```
-
-Some of these tools (like wmf and cups) provide both pkg-config and config
-tools support. You can force one or another via the method keyword:
+Vulkan can be located using `pkg-config`, or the `VULKAN_SDK` environment variable.
-```meson
-wmf_dep = dependency('wmf', method : 'config-tool')
-```
+`method` may be `auto`, `pkg-config` or `system`.
## WxWidgets
@@ -294,43 +382,6 @@ $ wx-config --cxxflags std stc
$ wx-config --libs std stc
```
-## LLVM
-
-Meson has native support for LLVM going back to version LLVM version 3.5.
-It supports a few additional features compared to other config-tool based
-dependencies.
-
-As of 0.44.0 Meson supports the `static` keyword argument for LLVM. Before this
-LLVM >= 3.9 would always dynamically link, while older versions would
-statically link, due to a quirk in `llvm-config`.
-
-### Modules, a.k.a. Components
-
-Meson wraps LLVM's concept of components in it's own modules concept.
-When you need specific components you add them as modules as meson will do the
-right thing:
-
-```meson
-llvm_dep = dependency('llvm', version : '>= 4.0', modules : ['amdgpu'])
-```
-
-As of 0.44.0 it can also take optional modules (these will affect the arguments
-generated for a static link):
-
-```meson
-llvm_dep = dependency(
- 'llvm', version : '>= 4.0', modules : ['amdgpu'], optional_modules : ['inteljitevents'],
-)
-```
-
-## Python3
-
-Python3 is handled specially by meson:
-1. Meson tries to use `pkg-config`.
-1. If `pkg-config` fails meson uses a fallback:
- - On Windows the fallback is the current `python3` interpreter.
- - On OSX the fallback is a framework dependency from `/Library/Frameworks`.
-
-Note that `python3` found by this dependency might differ from the one used in
-`python3` module because modules uses the current interpreter, but dependency tries
-`pkg-config` first.
+<hr>
+<a name="footnote1">1</a>: They may appear to be case-insensitive, if the
+ underlying file system happens to be case-insensitive.
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md
index 1bf333f..634fe79 100644
--- a/docs/markdown/Gnome-module.md
+++ b/docs/markdown/Gnome-module.md
@@ -234,6 +234,8 @@ one XML file.
* `sources`: list of XML files
* `interface_prefix`: prefix for the interface
* `namespace`: namespace of the interface
+* `extra_args`: (*Added 0.47.0*) additional command line arguments to pass
+* `autocleanup`: *(Added 0.47.0)* if set generates autocleanup code. Can be one of `none`, `objects` or `all`
* `object_manager`: *(Added 0.40.0)* if true generates object manager code
* `annotations`: *(Added 0.43.0)* list of lists of 3 strings for the annotation for `'ELEMENT', 'KEY', 'VALUE'`
* `docbook`: *(Added 0.43.0)* prefix to generate `'PREFIX'-NAME.xml` docbooks
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index a5733a2..9829781 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -214,6 +214,9 @@ the `@variable@` syntax.
was specified. It defaults to `c`, in which case preprocessor directives
will be prefixed with `#`, you can also use `nasm`, in which case the
prefix will be `%`.
+- `encoding` *(added v0.47.0)* set the file encoding for the input and output file,
+ defaults to utf-8. The supported encodings are those of python3, see
+ [standard-encodings](https://docs.python.org/3/library/codecs.html#standard-encodings).
### custom_target()
@@ -343,8 +346,9 @@ otherwise. This function supports the following keyword arguments:
dependency to find if it's available for multiple languages.
- `method` defines the way the dependency is detected, the default is
`auto` but can be overridden to be e.g. `qmake` for Qt development,
- and different dependencies support different values for this (though
- `auto` will work on all of them)
+ and [different dependencies support different values](
+ Dependencies.md#dependencies-with-custom-lookup-functionality)
+ for this (though `auto` will work on all of them)
- `native` if set to `true`, causes Meson to find the dependency on
the build machine system rather than the host system (i.e. where the
cross compiled binary will run on), usually only needed if you build
@@ -1161,6 +1165,10 @@ variables defined in the [`executable`](#executable) it is loaded by,
you will need to set the `export_dynamic` argument of the executable to
`true`.
+**Note:** Linking to a shared module is not supported on some platforms, notably
+OSX. Consider using a [`shared_library`](#shared_library) instead, if you need
+to both `dlopen()` and link with a library.
+
*Added 0.37.0*
### static_library()
@@ -1567,6 +1575,8 @@ the following methods:
- `get_define(definename)` returns the given preprocessor symbol's
value as a string or empty string if it is not defined.
+ Starting with 0.47.0, this method will concatenate string literals as
+ the compiler would. E.g. `"a" "b"` will become `"ab"`.
- `get_id()` returns a string identifying the compiler. For example,
`gcc`, `msvc`, [and more](Reference-tables.html#compiler-ids).
diff --git a/docs/markdown/Release-notes-for-0.44.0.md b/docs/markdown/Release-notes-for-0.44.0.md
index 56956d7..d765940 100644
--- a/docs/markdown/Release-notes-for-0.44.0.md
+++ b/docs/markdown/Release-notes-for-0.44.0.md
@@ -145,3 +145,9 @@ myprog = find_program('myscript.py')
```
Then Meson will run the script with its internal Python version if necessary.
+
+## Libwmf dependency now supports libwmf-config
+
+Earlier, `dependency('libwmf')` could only detect the library with pkg-config
+files. Now, if pkg-config files are not found, Meson will look for
+`libwmf-config` and if it's found, will use that to find the library.
diff --git a/docs/markdown/Release-notes-for-0.47.0.md b/docs/markdown/Release-notes-for-0.47.0.md
index 58d47ee..fa4a34c 100644
--- a/docs/markdown/Release-notes-for-0.47.0.md
+++ b/docs/markdown/Release-notes-for-0.47.0.md
@@ -21,3 +21,9 @@ Added the function `subdir_done()`. Its invocation exits the current script at
the point of invocation. All previously invoked build targets and commands are
build/executed. All following ones are ignored. If the current script was
invoked via `subdir()` the parent script continues normally.
+
+## Concatenate string literals returned from get_define
+
+After obtaining the value of a preprocessor symbol consecutive string literals
+are merged into a single string literal.
+For example a preprocessor symbol's value `"ab" "cd"` is returned as `"abcd"`.
diff --git a/docs/markdown/snippets/configure_file_encoding.md b/docs/markdown/snippets/configure_file_encoding.md
new file mode 100644
index 0000000..8082177
--- /dev/null
+++ b/docs/markdown/snippets/configure_file_encoding.md
@@ -0,0 +1,12 @@
+## New encoding keyword for configure_file
+
+Add a new keyword to [`configure_file()`](#Reference-manual.md#configure_file)
+that allows the developer to specify the input and output file encoding.
+
+If the file encoding of the input is not UTF-8 meson can crash (see #1542).
+A crash as with UTF-16 is the best case and the worst meson will silently
+corrupt the output file for example with ISO-2022-JP. For additional details
+see pull request #3135.
+
+The new keyword defaults to UTF-8 and the documentation strongly suggest to
+convert the file to UTF-8 when possible.
diff --git a/docs/markdown/snippets/gdbus_codegen_options.md b/docs/markdown/snippets/gdbus_codegen_options.md
new file mode 100644
index 0000000..d3dd84c
--- /dev/null
+++ b/docs/markdown/snippets/gdbus_codegen_options.md
@@ -0,0 +1,14 @@
+## New options to gnome.gdbus_codegen
+
+You can now pass additional arguments to gdbus-codegen using the `extra_args`
+keyword. This is the same for the other gnome function calls.
+
+Meson now automatically adds autocleanup support to the generated code. This
+can be modified by setting the autocleanup keyword.
+
+For example:
+
+ sources += gnome.gdbus_codegen('com.mesonbuild.Test',
+ 'com.mesonbuild.Test.xml',
+ autocleanup : 'none',
+ extra_args : ['--pragma-once'])