summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Wayne Norton <norton@alum.mit.edu>2012-07-28 23:04:51 +0900
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-28 19:36:46 +0200
commit2d62896de0072b6dfeda82156f77584eff37f880 (patch)
tree1c7db281a3cfcb978ee05343d17917c18f5f81fd /src
parent74a82fa104288a21ef751f528f8056de826a33d6 (diff)
Fix -D handling
Diffstat (limited to 'src')
-rw-r--r--src/rebar_port_compiler.erl12
-rw-r--r--src/rebar_utils.erl6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 5941baa..b2ff699 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -156,15 +156,15 @@ setup_env(Config, ExtraEnv) ->
DefaultEnv = filter_env(default_env(), []),
RawPortEnv = rebar_config:get_list(Config, port_env, []),
PortEnv = filter_env(RawPortEnv, []),
- GlobalDefines = global_defines(Config),
- OverrideEnv = GlobalDefines ++ PortEnv ++ filter_env(ExtraEnv, []),
+ Defines = get_defines(Config),
+ OverrideEnv = Defines ++ PortEnv ++ filter_env(ExtraEnv, []),
RawEnv = apply_defaults(os_env(), DefaultEnv) ++ OverrideEnv,
expand_vars_loop(merge_each_var(RawEnv, [])).
-global_defines(Config) ->
- Defines = rebar_config:get_global(Config, defines, []),
- Flags = string:join(["-D" ++ D || D <- Defines], " "),
- [{"ERL_CFLAGS", "$ERL_CFLAGS " ++ Flags}].
+get_defines(Config) ->
+ RawDefines = rebar_config:get_xconf(Config, defines, []),
+ Defines = string:join(["-D" ++ D || D <- RawDefines], " "),
+ [{"ERL_CFLAGS", "$ERL_CFLAGS " ++ Defines}].
replace_extension(File, NewExt) ->
OldExt = filename:extension(File),
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 0e94d08..5da53dd 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -291,9 +291,9 @@ delayed_halt(Code) ->
-spec erl_opts(rebar_config:config()) -> list().
erl_opts(Config) ->
RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []),
- GlobalDefines = [{d, list_to_atom(D)} ||
- D <- rebar_config:get_global(Config, defines, [])],
- Opts = GlobalDefines ++ RawErlOpts,
+ Defines = [{d, list_to_atom(D)} ||
+ D <- rebar_config:get_xconf(Config, defines, [])],
+ Opts = Defines ++ RawErlOpts,
case proplists:is_defined(no_debug_info, Opts) of
true ->
[O || O <- Opts, O =/= no_debug_info];