<div dir="ltr"><div><div>Put compile options from code (i.e. -compile(myoption1)) into the options variable used as second argument in parse_transform/2. This makes it possible to access all compile options (i.e. the ones specified in the command-line and the ones specified in code) in a consistent way.</div>
<div><br></div><div>Here is a simple example:</div><div><br></div><div>(dummy_module.erl)</div><div><br></div><div>-module(dummy_module).<br></div><div><br></div><div>-compile({parse_transform, dummy_transform}).</div><div>
-compile(dummy_transform_option1).</div><div><br></div><div><br></div><div><br></div><div>(dummy_transform.erl)</div><div><br></div><div>-module(dummy_transform).<br></div><div><br></div><div>-export([parse_transform/2]).</div>
<div><br></div><div>parse_transform(Forms, Opts) -></div><div> true = lists:member(dummy_transform_option1, Opts),</div><div> Forms.</div></div><div><br></div><div><br></div><div>Links:</div><div><br></div><div>git fetch git://<a href="http://github.com/efcasado/otp.git">github.com/efcasado/otp.git</a> compile-options<br>
</div><div><br></div><a href="https://github.com/efcasado/otp/compare/erlang:maint...compile-options">https://github.com/efcasado/otp/compare/erlang:maint...compile-options</a><br><div><a href="https://github.com/efcasado/otp/compare/erlang:maint...compile-options.patch">https://github.com/efcasado/otp/compare/erlang:maint...compile-options.patch</a><br>
</div><div><br></div><div><div><a href="https://github.com/erlang/otp/pull/350">https://github.com/erlang/otp/pull/350</a></div></div><div><br></div><div><br></div></div>