This page lists code snippets for common tasks. These are written mostly using the C compiler, but the same approach should work on almost all other compilers.
# Set compiler
## Set compiler
When first running Meson, set it in an environment variable.
@ -10,14 +10,14 @@ When first running Meson, set it in an environment variable.
$ CC=mycc meson <options>
```
# Set default C/C++ language version
## Set default C/C++ language version
```meson
project('myproj', 'c', 'cpp',
default_options : ['c_std=c11', 'cpp_std=c++11'])
```
# Enable threads
## Enable threads
Lots of people seem to do this manually with `find_library('phtread')` or something similar. Do not do that. It is not portable. Instead do this.