Browse Source

Add platform_define support for erl_opts

Fixes jsx maps support.
Loïc Hoguin 10 years ago
parent
commit
0441997539
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/deps.mk

+ 6 - 0
core/deps.mk

@@ -156,6 +156,12 @@ define dep_autopatch_rebar.erl
 				lists:foreach(fun
 					({d, D}) ->
 						Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n");
+					({platform_define, Regex, D}) ->
+						case re:run("$(PLATFORM)", Regex, [{capture, none}]) of
+							nomatch -> ok;
+							match ->
+								Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n")
+						end;
 					({parse_transform, PT}) ->
 						Write("ERLC_OPTS += +'{parse_transform, " ++ atom_to_list(PT) ++ "}'\n");
 					(_) -> ok