| 1 |
# Reference tables |
| 2 |
|
| 3 |
## Compiler ids |
| 4 |
|
| 5 |
These are return values of the `get_id` (Compiler family) and |
| 6 |
`get_argument_syntax` (Argument syntax) method in a compiler object. |
| 7 |
|
| 8 |
| Value | Compiler family | Argument syntax | |
| 9 |
| ----- | --------------- | --------------- | |
| 10 |
| arm | ARM compiler | | |
| 11 |
| armclang | ARMCLANG compiler | | |
| 12 |
| ccomp | The CompCert formally-verified C compiler | | |
| 13 |
| ccrx | Renesas RX Family C/C++ compiler | | |
| 14 |
| clang | The Clang compiler | gcc | |
| 15 |
| clang-cl | The Clang compiler (MSVC compatible driver) | msvc | |
| 16 |
| dmd | D lang reference compiler | | |
| 17 |
| emscripten| Emscripten WASM compiler | | |
| 18 |
| flang | Classic Flang Fortran compiler | | |
| 19 |
| g95 | The G95 Fortran compiler | | |
| 20 |
| gcc | The GNU Compiler Collection | gcc | |
| 21 |
| intel | Intel compiler (Linux and Mac) | gcc | |
| 22 |
| intel-cl | Intel compiler (Windows) | msvc | |
| 23 |
| intel-llvm | Intel oneAPI LLVM-based compiler | | |
| 24 |
| intel-llvm-cl | Intel oneAPI LLVM-based compiler (Windows) | msvc | |
| 25 |
| lcc | Elbrus C/C++/Fortran Compiler | | |
| 26 |
| llvm | LLVM-based compiler (Swift, D) | | |
| 27 |
| llvm-flang| Flang Fortran compiler (LLVM-based) | | |
| 28 |
| mono | Xamarin C# compiler | | |
| 29 |
| mwccarm | Metrowerks C/C++ compiler for Embedded ARM | | |
| 30 |
| mwcceppc | Metrowerks C/C++ compiler for Embedded PowerPC | | |
| 31 |
| msvc | Microsoft Visual Studio | msvc | |
| 32 |
| nagfor | The NAG Fortran compiler | | |
| 33 |
| nvidia_hpc| NVidia HPC SDK compilers | | |
| 34 |
| nvcc | NVidia CUDA compiler | | |
| 35 |
| open64 | The Open64 Fortran Compiler | | |
| 36 |
| pathscale | The Pathscale Fortran compiler | | |
| 37 |
| pgi | Portland PGI C/C++/Fortran compilers | | |
| 38 |
| rustc | Rust compiler | | |
| 39 |
| sun | Sun Fortran compiler | | |
| 40 |
| c2000 | Texas Instruments C/C++ Compiler (C2000) | | |
| 41 |
| c6000 | Texas Instruments C/C++ Compiler (C6000) | | |
| 42 |
| ti | Texas Instruments C/C++ Compiler | | |
| 43 |
| valac | Vala compiler | | |
| 44 |
| xc16 | Microchip XC16 C compiler | | |
| 45 |
| cython | The Cython compiler | | |
| 46 |
| nasm | The NASM compiler (Since 0.64.0) | | |
| 47 |
| yasm | The YASM compiler (Since 0.64.0) | | |
| 48 |
| ml | Microsoft Macro Assembler for x86 and x86_64 (Since 0.64.0) | msvc | |
| 49 |
| armasm | Microsoft Macro Assembler for ARM and AARCH64 (Since 0.64.0) | | |
| 50 |
| mwasmarm | Metrowerks Assembler for Embedded ARM | | |
| 51 |
| mwasmeppc | Metrowerks Assembler for Embedded PowerPC | | |
| 52 |
| tasking | TASKING VX-toolset | | |
| 53 |
|
| 54 |
## Linker ids |
| 55 |
|
| 56 |
These are return values of the `get_linker_id` method in a compiler object. |
| 57 |
|
| 58 |
| Value | Linker family | |
| 59 |
| ----- | --------------- | |
| 60 |
| ld.bfd | The GNU linker | |
| 61 |
| ld.gold | The GNU gold linker | |
| 62 |
| ld.lld | The LLVM linker, with the GNU interface | |
| 63 |
| ld.mold | The fast MOLD linker | |
| 64 |
| ld.solaris | Solaris and illumos | |
| 65 |
| ld.wasm | emscripten's wasm-ld linker | |
| 66 |
| ld.zigcc | The Zig linker (C/C++ frontend; GNU-like) | |
| 67 |
| ld64 | Apple ld64 | |
| 68 |
| ld64.lld | The LLVM linker, with the ld64 interface | |
| 69 |
| link | MSVC linker | |
| 70 |
| lld-link | The LLVM linker, with the MSVC interface | |
| 71 |
| xilink | Used with Intel-cl only, MSVC like | |
| 72 |
| optlink | optlink (used with DMD) | |
| 73 |
| rlink | The Renesas linker, used with CCrx only | |
| 74 |
| xc16-ar | The Microchip linker, used with XC16 only | |
| 75 |
| ar2000 | The Texas Instruments linker, used with C2000 only | |
| 76 |
| ti-ar | The Texas Instruments linker | |
| 77 |
| ar6000 | The Texas Instruments linker, used with C6000 only | |
| 78 |
| armlink | The ARM linker (arm and armclang compilers) | |
| 79 |
| pgi | Portland/Nvidia PGI | |
| 80 |
| nvlink | Nvidia Linker used with cuda | |
| 81 |
| ccomp | CompCert used as the linker driver | |
| 82 |
| mwldarm | The Metrowerks Linker with the ARM interface, used with mwccarm only | |
| 83 |
| mwldeppc | The Metrowerks Linker with the PowerPC interface, used with mwcceppc only | |
| 84 |
| tasking | TASKING VX-toolset | |
| 85 |
|
| 86 |
For languages that don't have separate dynamic linkers such as C# and Java, the |
| 87 |
`get_linker_id` will return the compiler name. |
| 88 |
|
| 89 |
## Script environment variables |
| 90 |
|
| 91 |
| Value | Comment | |
| 92 |
| ----- | ------- | |
| 93 |
| MESONINTROSPECT | Command to run to run the introspection command, may be of the form `python /path/to/meson introspect`, user is responsible for splitting the path if necessary. | |
| 94 |
| MESONREWRITE | Command to run to run the rewriting command, only set when running `dist` scripts | |
| 95 |
| MESON_BUILD_ROOT | Absolute path to the build dir | |
| 96 |
| MESON_DIST_ROOT | Points to the root of the staging directory, only set when running `dist` scripts | |
| 97 |
| MESON_SOURCE_ROOT | Absolute path to the source dir | |
| 98 |
| MESON_SUBDIR | Current subdirectory, only set for `run_command` | |
| 99 |
|
| 100 |
## CPU families |
| 101 |
|
| 102 |
These are returned by the `cpu_family` method of `build_machine`, |
| 103 |
`host_machine` and `target_machine`. For cross compilation they are |
| 104 |
set in the cross file. |
| 105 |
|
| 106 |
| Value | Comment | |
| 107 |
| ----- | ------- | |
| 108 |
| aarch64 | 64 bit ARM processor | |
| 109 |
| alpha | DEC Alpha processor | |
| 110 |
| arc | 32 bit ARC processor | |
| 111 |
| arm | 32 bit ARM processor | |
| 112 |
| avr | Atmel AVR processor | |
| 113 |
| c2000 | 32 bit C2000 processor | |
| 114 |
| c6000 | 32 bit C6000 processor | |
| 115 |
| csky | 32 bit CSky processor | |
| 116 |
| dspic | 16 bit Microchip dsPIC | |
| 117 |
| e2k | MCST Elbrus processor | |
| 118 |
| ft32 | 32 bit Bridgetek MCU | |
| 119 |
| ia64 | Itanium processor | |
| 120 |
| loongarch64 | 64 bit Loongson processor| |
| 121 |
| m68k | Motorola 68000 processor | |
| 122 |
| microblaze | MicroBlaze processor | |
| 123 |
| mips | 32 bit MIPS processor | |
| 124 |
| mips64 | 64 bit MIPS processor | |
| 125 |
| msp430 | 16 bit MSP430 processor | |
| 126 |
| parisc | HP PA-RISC processor | |
| 127 |
| pic24 | 16 bit Microchip PIC24 | |
| 128 |
| ppc | 32 bit PPC processors | |
| 129 |
| ppc64 | 64 bit PPC processors | |
| 130 |
| riscv32 | 32 bit RISC-V Open ISA | |
| 131 |
| riscv64 | 64 bit RISC-V Open ISA | |
| 132 |
| rl78 | Renesas RL78 | |
| 133 |
| rx | Renesas RX 32 bit MCU | |
| 134 |
| s390 | IBM zSystem s390 | |
| 135 |
| s390x | IBM zSystem s390x | |
| 136 |
| sh4 | SuperH SH-4 | |
| 137 |
| sparc | 32 bit SPARC | |
| 138 |
| sparc64 | SPARC v9 processor | |
| 139 |
| sw_64 | 64 bit sunway processor | |
| 140 |
| wasm32 | 32 bit Webassembly | |
| 141 |
| wasm64 | 64 bit Webassembly | |
| 142 |
| x86 | 32 bit x86 processor | |
| 143 |
| x86_64 | 64 bit x86 processor | |
| 144 |
| tricore | Tricore 32 bit processor | |
| 145 |
|
| 146 |
|
| 147 |
Any cpu family not listed in the above list is not guaranteed to |
| 148 |
remain stable in future releases. |
| 149 |
|
| 150 |
Those porting from autotools should note that Meson does not add |
| 151 |
endianness to the name of the cpu_family. For example, autotools |
| 152 |
will call little endian PPC64 "ppc64le", Meson will not, you must |
| 153 |
also check the `.endian()` value of the machine for this information. |
| 154 |
|
| 155 |
## Operating system names |
| 156 |
|
| 157 |
These are provided by the `.system()` method call. |
| 158 |
|
| 159 |
| Value | Comment | |
| 160 |
| ----- | ------- | |
| 161 |
| android | By convention only, subject to change | |
| 162 |
| cygwin | Cygwin or MSYS2 environment on Windows | |
| 163 |
| darwin | Either OSX or iOS | |
| 164 |
| dragonfly | DragonFly BSD | |
| 165 |
| emscripten | Emscripten's JavaScript environment | |
| 166 |
| freebsd | FreeBSD and its derivatives | |
| 167 |
| gnu | GNU Hurd | |
| 168 |
| haiku | | |
| 169 |
| linux | | |
| 170 |
| netbsd | | |
| 171 |
| openbsd | | |
| 172 |
| windows | Native Windows (not Cygwin or MSYS2) | |
| 173 |
| sunos | illumos and Solaris | |
| 174 |
|
| 175 |
Any string not listed above is not guaranteed to remain stable in |
| 176 |
future releases. |
| 177 |
|
| 178 |
## Kernel names (since 1.2.0) |
| 179 |
|
| 180 |
Native names as returned by the `.kernel()` method. |
| 181 |
|
| 182 |
| Value | Comment | |
| 183 |
| ----- | ------- | |
| 184 |
| linux | | |
| 185 |
| freebsd | | |
| 186 |
| openbsd | | |
| 187 |
| netbsd | | |
| 188 |
| gnu | GNU Hurd | |
| 189 |
| nt | | |
| 190 |
| xnu | Kernel of various Apple OSes | |
| 191 |
| illumos | Kernel derived from OpenSolaris by community efforts | |
| 192 |
| solaris | Kernel derived from OpenSolaris by Oracle | |
| 193 |
| dragonfly | | |
| 194 |
| haiku| | |
| 195 |
| none | For e.g. bare metal embedded | |
| 196 |
|
| 197 |
|
| 198 |
## Subsystem names (since 1.2.0) |
| 199 |
|
| 200 |
A more specific description of the system in question. Most values are |
| 201 |
meant to be used in cross files only, as those platforms can not run |
| 202 |
Meson natively. |
| 203 |
|
| 204 |
| Value | Comment | |
| 205 |
| ----- | ------- | |
| 206 |
| macos | Apple macOS (formerly OSX) | |
| 207 |
| ios | Apple iOS | |
| 208 |
| ios-simulator | | |
| 209 |
| tvos | Apple tvOS | |
| 210 |
| tvos-simulator | | |
| 211 |
| watchos | Apple watchOS | |
| 212 |
| watchos-simulator | | |
| 213 |
|
| 214 |
## Language arguments parameter names |
| 215 |
|
| 216 |
These are the parameter names for passing language specific arguments |
| 217 |
to your build target. |
| 218 |
|
| 219 |
| Language | compiler name | linker name | |
| 220 |
| ------------- | -------------- | ----------------- | |
| 221 |
| C | c_args | c_link_args | |
| 222 |
| C++ | cpp_args | cpp_link_args | |
| 223 |
| C# | cs_args | cs_link_args | |
| 224 |
| CUDA | cuda_args | cuda_link_args | |
| 225 |
| D | d_args | d_link_args | |
| 226 |
| Fortran | fortran_args | fortran_link_args | |
| 227 |
| Java | java_args | java_link_args | |
| 228 |
| Objective C | objc_args | objc_link_args | |
| 229 |
| Objective C++ | objcpp_args | objcpp_link_args | |
| 230 |
| Rust | rust_args | rust_link_args | |
| 231 |
| Vala | vala_args | vala_link_args | |
| 232 |
| Cython | cython_args | cython_link_args | |
| 233 |
| NASM | nasm_args | N/A | |
| 234 |
| MASM | masm_args | N/A | |
| 235 |
| Linear ASM | linearasm_args | N/A | |
| 236 |
|
| 237 |
All these `<lang>_*` options are specified per machine. See in |
| 238 |
[specifying options per |
| 239 |
machine](Builtin-options.md#Specifying-options-per-machine) for on how |
| 240 |
to do this in cross builds. |
| 241 |
|
| 242 |
## Compiler and linker flag environment variables |
| 243 |
|
| 244 |
These environment variables will be used to modify the compiler and |
| 245 |
linker flags. |
| 246 |
|
| 247 |
It is recommended that you **do not use these**. They are provided |
| 248 |
purely to for backwards compatibility with other build systems. There |
| 249 |
are many caveats to their use, especially when rebuilding the project. |
| 250 |
It is **highly** recommended that you use [the command line |
| 251 |
arguments](#language-arguments-parameter-names) instead. |
| 252 |
|
| 253 |
| Name | Comment | |
| 254 |
| ----- | ------- | |
| 255 |
| CFLAGS | Flags for the C compiler | |
| 256 |
| CXXFLAGS | Flags for the C++ compiler | |
| 257 |
| CUFLAGS | Flags for the CUDA compiler | |
| 258 |
| OBJCFLAGS | Flags for the Objective C compiler | |
| 259 |
| FFLAGS | Flags for the Fortran compiler | |
| 260 |
| DFLAGS | Flags for the D compiler | |
| 261 |
| VALAFLAGS | Flags for the Vala compiler | |
| 262 |
| RUSTFLAGS | Flags for the Rust compiler | |
| 263 |
| CYTHONFLAGS | Flags for the Cython compiler | |
| 264 |
| LDFLAGS | The linker flags, used for all languages | |
| 265 |
|
| 266 |
N.B. these settings are specified per machine, and so the environment |
| 267 |
variables actually come in pairs. See the [environment variables per |
| 268 |
machine](#Environment-variables-per-machine) section for details. |
| 269 |
|
| 270 |
## Function Attributes |
| 271 |
|
| 272 |
These are the parameters names that are supported using |
| 273 |
`compiler.has_function_attribute()` or |
| 274 |
`compiler.get_supported_function_attributes()` |
| 275 |
|
| 276 |
### GCC `__attribute__` |
| 277 |
|
| 278 |
These values are supported using the GCC style `__attribute__` annotations, |
| 279 |
which are supported by GCC, Clang, and other compilers. |
| 280 |
|
| 281 |
|
| 282 |
| Name | |
| 283 |
|-----------------------------| |
| 284 |
| alias | |
| 285 |
| aligned | |
| 286 |
| alloc_size | |
| 287 |
| always_inline | |
| 288 |
| artificial | |
| 289 |
| cold | |
| 290 |
| const | |
| 291 |
| constructor | |
| 292 |
| constructor_priority | |
| 293 |
| deprecated | |
| 294 |
| destructor | |
| 295 |
| error | |
| 296 |
| externally_visible | |
| 297 |
| fallthrough | |
| 298 |
| flatten | |
| 299 |
| format | |
| 300 |
| format_arg | |
| 301 |
| force_align_arg_pointer³ | |
| 302 |
| gnu_inline | |
| 303 |
| hot | |
| 304 |
| ifunc | |
| 305 |
| malloc | |
| 306 |
| noclone | |
| 307 |
| noinline | |
| 308 |
| nonnull | |
| 309 |
| noreturn | |
| 310 |
| nothrow | |
| 311 |
| null_terminated_string_arg⁷ | |
| 312 |
| optimize | |
| 313 |
| packed | |
| 314 |
| pure | |
| 315 |
| retain⁴ | |
| 316 |
| returns_nonnull | |
| 317 |
| section⁵ | |
| 318 |
| sentinel⁵ | |
| 319 |
| unused | |
| 320 |
| used | |
| 321 |
| vector_size⁶ | |
| 322 |
| visibility* | |
| 323 |
| visibility:default† | |
| 324 |
| visibility:hidden† | |
| 325 |
| visibility:internal† | |
| 326 |
| visibility:protected† | |
| 327 |
| warning | |
| 328 |
| warn_unused_result | |
| 329 |
| weak | |
| 330 |
| weakref | |
| 331 |
|
| 332 |
\* *Changed in 0.52.0* the "visibility" target no longer includes |
| 333 |
"protected", which is not present in Apple's clang. |
| 334 |
|
| 335 |
† *New in 0.52.0* These split visibility attributes are preferred to the plain |
| 336 |
"visibility" as they provide narrower checks. |
| 337 |
|
| 338 |
³ *New in 0.55.0* |
| 339 |
|
| 340 |
⁴ *New in 0.62.0* |
| 341 |
|
| 342 |
⁵ *New in 0.63.0* |
| 343 |
|
| 344 |
⁶ *New in 1.1.0* |
| 345 |
|
| 346 |
⁷ *New in 1.5.0* |
| 347 |
|
| 348 |
### MSVC __declspec |
| 349 |
|
| 350 |
These values are supported using the MSVC style `__declspec` annotation, |
| 351 |
which are supported by MSVC, GCC, Clang, and other compilers. |
| 352 |
|
| 353 |
| Name | |
| 354 |
|----------------------| |
| 355 |
| dllexport | |
| 356 |
| dllimport | |
| 357 |
|
| 358 |
|
| 359 |
## Dependency lookup methods |
| 360 |
|
| 361 |
These are the values that can be passed to `dependency` function's |
| 362 |
`method` keyword argument. |
| 363 |
|
| 364 |
| Name | Comment | |
| 365 |
| ----- | ------- | |
| 366 |
| auto | Automatic method selection | |
| 367 |
| pkg-config | Use Pkg-Config | |
| 368 |
| cmake | Look up as a CMake module | |
| 369 |
| config-tool | Use a custom dep tool such as `cups-config` | |
| 370 |
| system | System provided (e.g. OpenGL) | |
| 371 |
| extraframework | A macOS/iOS framework | |
| 372 |
|
| 373 |
|
| 374 |
## Compiler and Linker selection variables |
| 375 |
|
| 376 |
N.B. these settings are specified per machine, and so the environment |
| 377 |
variables actually come in pairs. See the [environment variables per |
| 378 |
machine](#Environment-variables-per-machine) section for details. |
| 379 |
|
| 380 |
| Language | Compiler | Linker | Note | |
| 381 |
|---------------|----------|-----------|---------------------------------------------| |
| 382 |
| C | CC | CC_LD | | |
| 383 |
| C++ | CXX | CXX_LD | | |
| 384 |
| D | DC | DC_LD | Before 0.54 D_LD* | |
| 385 |
| Fortran | FC | FC_LD | Before 0.54 F_LD* | |
| 386 |
| Objective-C | OBJC | OBJC_LD | | |
| 387 |
| Objective-C++ | OBJCXX | OBJCXX_LD | Before 0.54 OBJCPP_LD* | |
| 388 |
| Rust | RUSTC | RUSTC_LD | Before 0.54 RUST_LD* | |
| 389 |
| Vala | VALAC | | Use CC_LD. Vala transpiles to C | |
| 390 |
| C# | CSC | CSC | The linker is the compiler | |
| 391 |
| Cython | CYTHON | | | |
| 392 |
| nasm | NASM | | Uses the C linker | |
| 393 |
| archiver | | AR | | |
| 394 |
|
| 395 |
*The old environment variables are still supported, but are deprecated |
| 396 |
and will be removed in a future version of Meson. |
| 397 |
|
| 398 |
*changed in 1.3.0* Paths with spaces were split unconditionally to extract |
| 399 |
components such as the [path to Ccache](Feature-autodetection.md#ccache), |
| 400 |
intrinsic compiler flags like `-m32` or `--target`, etc. This broke passing |
| 401 |
a hardcoded compiler path to CMake subprojects. To work around this, paths |
| 402 |
must be wrapped with double quotes: |
| 403 |
|
| 404 |
```bash |
| 405 |
export CC='"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"' |
| 406 |
``` |
| 407 |
|
| 408 |
You can also set the values through [machine files](Machine-files.md#binaries). |
| 409 |
|
| 410 |
*New in 1.3.0* Paths that point to an existing executable no longer need |
| 411 |
wrapping: |
| 412 |
|
| 413 |
```bash |
| 414 |
export CC='C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe' |
| 415 |
``` |
| 416 |
|
| 417 |
|
| 418 |
## Environment variables per machine |
| 419 |
|
| 420 |
Since *0.54.0*, Following Autotool and other legacy build systems, |
| 421 |
environment variables that affect machine-specific settings come in |
| 422 |
pairs: for every bare environment variable `FOO`, there is a suffixed |
| 423 |
`FOO_FOR_BUILD`, where `FOO` just affects the host machine |
| 424 |
configuration, while `FOO_FOR_BUILD` just affects the build machine |
| 425 |
configuration. For example: |
| 426 |
|
| 427 |
- `PKG_CONFIG_PATH_FOR_BUILD` controls the paths pkg-config will search for |
| 428 |
just `native: true` dependencies (build machine). |
| 429 |
|
| 430 |
- `PKG_CONFIG_PATH` controls the paths pkg-config will search for just |
| 431 |
`native: false` dependencies (host machine). |
| 432 |
|
| 433 |
This mirrors the `build.` prefix used for (built-in) Meson options, |
| 434 |
which has the same meaning. |
| 435 |
|
| 436 |
This is useful for cross builds. In the native builds, build = host, |
| 437 |
and the unsuffixed environment variables alone will suffice. |
| 438 |
|
| 439 |
Prior to *0.54.0*, there was no `_FOR_BUILD`-suffixed variables, and |
| 440 |
most environment variables only effected native machine |
| 441 |
configurations, though this wasn't consistent (e.g. `PKG_CONFIG_PATH` |
| 442 |
still affected cross builds). |