Put compile options from code into parse_transform/2 options variable
Enrique Fernández Casado <[email protected]> Thu, 1 May 2014 09:19:42 +0200
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CAN1HLQKKjtTGrDTCJWKeNL+DMqr9RNRAJTT7+UUHjBCqkuoJcQ@mail.gmail.com> |
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.
Here is a simple example:
(dummy_module.erl)
-module(dummy_module).
-compile({parse_transform, dummy_transform}).
-compile(dummy_transform_option1).
(dummy_transform.erl)
-module(dummy_transform).
-export([parse_transform/2]).
parse_transform(Forms, Opts) ->
true = lists:member(dummy_transform_option1, Opts),
Forms.
Links:
git fetch git://github.com/efcasado/otp.git compile-options
https://github.com/efcasado/otp/compare/erlang:maint...compile-options
https://github.com/efcasado/otp/compare/erlang:maint...compile-options.patch
https://github.com/erlang/otp/pull/350
_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches