Code.put_compiler_option

You're seeing just the function put_compiler_option, go back to Code module for more information.
Link to this function

put_compiler_option(key, value)

View Source (since 1.10.0)

Specs

put_compiler_option(atom(), term()) :: :ok

Stores a compilation option.

These options are global since they are stored by Elixir's code server.

Available options are:

  • :docs - when true, retain documentation in the compiled module. Defaults to true.

  • :debug_info - when true, retain debug information in the compiled module. This allows a developer to reconstruct the original source code. Defaults to true.

  • :ignore_module_conflict - when true, override modules that were already defined without raising errors. Defaults to false.

  • :relative_paths - when true, use relative paths in quoted nodes, warnings and errors generated by the compiler. Note disabling this option won't affect runtime warnings and errors. Defaults to true.

  • :warnings_as_errors - causes compilation to fail when warnings are generated. Defaults to false.

  • :no_warn_undefined (since v1.10.0) - list of modules and {Mod, fun, arity} tuples that will not emit warnings that the module or function does not exist at compilation time. Pass atom :all to skip warning for all undefined functions. This can be useful when doing dynamic compilation. Defaults to [].

  • :tracers (since v1.10.0) - a list of tracers (modules) to be used during compilation. See the module docs for more information. Defaults to [].

  • :parser_options (since v1.10.0) - a keyword list of options to be given to the parser when compiling files. It accepts the same options as string_to_quoted/2 (except by the options that change the AST itself). This can be used in combination with the tracer to retrieve localized information about events happening during compilation. Defaults to [].

It always returns :ok. Raises an error for invalid options.

Examples

Code.put_compiler_option(:debug_info, true)
#=> :ok