This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

CONFIG_COMPILER_OPT

Custom compiler options

Type: string

Help

This option is a free-form string that is passed to the compiler
when building all parts of a project (i.e. kernel).
The compiler options specified by this string supplement the
predefined set of compiler supplied by the build system,
and can be used to change compiler optimization, warning and error
messages, and so on.

Defaults

No defaults. Implicitly defaults to the empty string.

Kconfig definition

At Kconfig.zephyr:274

Included via Kconfig:8

Menu path: (Top) → Build and Link Features → Compiler Options

config COMPILER_OPT
    string "Custom compiler options"
    help
      This option is a free-form string that is passed to the compiler
      when building all parts of a project (i.e. kernel).
      The compiler options specified by this string supplement the
      predefined set of compiler supplied by the build system,
      and can be used to change compiler optimization, warning and error
      messages, and so on.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)