Code.put_compiler_option
put_compiler_option
, go back to Code module for more information.
Specs
Stores a compilation option.
These options are global since they are stored by Elixir's code server.
Available options are:
:docs
- whentrue
, retain documentation in the compiled module. Defaults totrue
.:debug_info
- whentrue
, retain debug information in the compiled module. This allows a developer to reconstruct the original source code. Defaults totrue
.:ignore_module_conflict
- whentrue
, override modules that were already defined without raising errors. Defaults tofalse
.:relative_paths
- whentrue
, 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 totrue
.:warnings_as_errors
- causes compilation to fail when warnings are generated. Defaults tofalse
.: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 asstring_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