summaryrefslogtreecommitdiff
path: root/src/rebar_port_compiler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_port_compiler.erl')
-rw-r--r--src/rebar_port_compiler.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 05e157b..bee9644 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -155,14 +155,9 @@ setup_env(Config) ->
%% ===================================================================
global_defines() ->
- [begin
- case string:tokens(D, "=") of
- [Var, Val] ->
- {Var, Val};
- [Def] ->
- {Def, "1"}
- end
- end || D <- rebar_config:get_global(defines, [])].
+ Defines = rebar_config:get_global(defines, []),
+ Flags = string:join(["-D" ++ D || D <- Defines], " "),
+ [{"ERL_CFLAGS", "$ERL_CFLAGS " ++ Flags}].
expand_sources([], Acc) ->
Acc;