add_project_arguments()

Adds project specific arguments to the compiler command line.

This function behaves in the same way as add_global_arguments() except that the arguments are only used for the current project, they won't be used in any other subproject.

Signature

# Adds project specific arguments to the compiler command line
void add_project_arguments(
  str Compiler argument...,  # The compiler arguments to add

  # Keyword arguments:
  language : array[str]  [required]  # Specifies the language(s) that the arguments should be
  native   : bool                    # A boolean specifying whether the arguments should be
)

Arguments

The function accepts between 0 and infinity variadic arguments (Compiler argument...) of type str.

The compiler arguments to add

The function add_project_arguments() accepts the following keyword arguments:

Name Type Description Tags
language array[str]

Specifies the language(s) that the arguments should be applied to. If an array of languages is given, the arguments are added to each of the corresponding compiler command lines. Note that there is no way to remove an argument set in this way. If you have an argument that is only used in a subset of targets, you have to specify it in per-target flags.

native bool

A boolean specifying whether the arguments should be applied to the native or cross compilation. If true the arguments will only be used for native compilations. If false the arguments will only be used in cross compilations. If omitted, the flags are added to native compilations if compiling natively and cross compilations (only) when cross compiling.

(since 0.48.0)

default = false

The results of the search are