subdir()

Enters the specified subdirectory and executes the meson.build file in it. Once that is done, it returns and execution continues on the line following this subdir() command. Variables defined in that meson.build file are then available for use in later parts of the current build file and in all subsequent build files executed with subdir().

Note that this means that each meson.build file in a source tree can and must only be executed once.

Signature

# Enters the specified subdirectory and executes the `meson
void subdir(
  str dir_name,     # Directory relative to the current `meson

  # Keyword arguments:
  if_found : array[dep]  # Only enter the subdir if all dep.found() methods return `true`.
)

Arguments

The function subdir() accepts the following positional arguments:

Name Type Description Tags
dir_name str

Directory relative to the current meson.build to enter.

Cannot contain ..

Finally, subdir() accepts the following keyword arguments:

Name Type Description Tags
if_found array[dep]

Only enter the subdir if all dep.found() methods return true.

(since 0.44.0)

The results of the search are