Reference tables

Compiler ids

These are return values of the get_id (Compiler family) and get_argument_syntax (Argument syntax) method in a compiler object.

ValueCompiler familyArgument syntax
armARM compiler
armclangARMCLANG compiler
ccrxRenesas RX Family C/C++ compiler
clangThe Clang compilergcc
clang-clThe Clang compiler (MSVC compatible driver)msvc
dmdD lang reference compiler
g95The G95 Fortran compiler
gccThe GNU Compiler Collectiongcc
intelIntel compilermsvc on windows, otherwise gcc
lccElbrus C/C++/Fortran Compiler
llvmLLVM-based compiler (Swift, D)
monoXamarin C# compiler
msvcMicrosoft Visual Studiomsvc
nagforThe NAG Fortran compiler
open64The Open64 Fortran Compiler
pathscaleThe Pathscale Fortran compiler
pgiThe Portland Fortran compiler
rustcRust compiler
sunSun Fortran compiler
valacVala compiler

Script environment variables

ValueComment
MESONINTROSPECTCommand 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.
MESON_BUILD_ROOTAbsolute path to the build dir
MESON_DIST_ROOTPoints to the root of the staging directory, only set when running dist scripts
MESON_SOURCE_ROOTAbsolute path to the source dir
MESON_SUBDIRCurrent subdirectory, only set for run_command

CPU families

These are returned by the cpu_family method of build_machine, host_machine and target_machine. For cross compilation they are set in the cross file.

ValueComment
aarch6464 bit ARM processor
arc32 bit ARC processor
arm32 bit ARM processor
e2kMCST Elbrus processor
ia64Itanium processor
mips32 bit MIPS processor
mips6464 bit MIPS processor
pariscHP PA-RISC processor
ppc32 bit PPC processors
ppc6464 bit PPC processors
riscv3232 bit RISC-V Open ISA
riscv6464 bit RISC-V Open ISA
rl78Renesas RL78
rxRenesas RX 32 bit MCU
s390xIBM zSystem s390x
sparc32 bit SPARC
sparc64SPARC v9 processor
x8632 bit x86 processor
x86_6464 bit x86 processor

Any cpu family not listed in the above list is not guaranteed to remain stable in future releases.

Those porting from autotools should note that meson does not add endianness to the name of the cpu_family. For example, autotools will call little endian PPC64 “ppc64le”, meson will not, you must also check the .endian() value of the machine for this information.

Operating system names

These are provided by the .system() method call.

ValueComment
cygwinThe Cygwin environment for Windows
darwinEither OSX or iOS
dragonflyDragonFly BSD
freebsdFreeBSD and its derivatives
gnuGNU Hurd
haiku
linux
netbsd
windowsAny version of Windows

Any string not listed above is not guaranteed to remain stable in future releases.

Language arguments parameter names

These are the parameter names for passing language specific arguments to your build target.

LanguageParameter name
Cc_args
C++cpp_args
C#cs_args
Dd_args
Fortranfortran_args
Javajava_args
Objective Cobjc_args
Objective C++objcpp_args
Rustrust_args
Valavala_args

Compiler and linker flag environment variables

These environment variables will be used to modify the compiler and linker flags.

NameComment
CFLAGSFlags for the C compiler
CXXFLAGSFlags for the C++ compiler
OBJCFLAGSFlags for the Objective C compiler
FFLAGSFlags for the Fortran compiler
DFLAGSFlags for the D compiler
VALAFLAGSFlags for the Vala compiler
RUSTFLAGSFlags for the Rust compiler
LDFLAGSThe linker flags, used for all languages

Function Attributes

These are the parameters names that are supported using compiler.has_function_attribute() or compiler.get_supported_function_attributes()

GCC __attribute__

These values are supported using the GCC style __attribute__ annotations, which are supported by GCC, Clang, and other compilers.

Name
alias
aligned
alloc_size
always_inline
artificial
cold
const
constructor
constructor_priority
deprecated
destructor
error
externally_visible
fallthrough
flatten
format
format_arg
gnu_inline
hot
ifunc
malloc
noclone
noinline
nonnull
noreturn
nothrow
optimize
packed
pure
returns_nonnull
unused
used
visibility
warning
warn_unused_result
weak
weakreaf

MSVC __declspec

These values are supported using the MSVC style __declspec annotation, which are supported by MSVC, GCC, Clang, and other compilers.

Name
dllexport
dllimport