mirror of
https://github.com/correl/rebar.git
synced 2025-01-05 11:08:16 +00:00
Fix -D handling
This commit is contained in:
parent
74a82fa104
commit
2d62896de0
2 changed files with 9 additions and 9 deletions
|
@ -156,15 +156,15 @@ setup_env(Config, ExtraEnv) ->
|
||||||
DefaultEnv = filter_env(default_env(), []),
|
DefaultEnv = filter_env(default_env(), []),
|
||||||
RawPortEnv = rebar_config:get_list(Config, port_env, []),
|
RawPortEnv = rebar_config:get_list(Config, port_env, []),
|
||||||
PortEnv = filter_env(RawPortEnv, []),
|
PortEnv = filter_env(RawPortEnv, []),
|
||||||
GlobalDefines = global_defines(Config),
|
Defines = get_defines(Config),
|
||||||
OverrideEnv = GlobalDefines ++ PortEnv ++ filter_env(ExtraEnv, []),
|
OverrideEnv = Defines ++ PortEnv ++ filter_env(ExtraEnv, []),
|
||||||
RawEnv = apply_defaults(os_env(), DefaultEnv) ++ OverrideEnv,
|
RawEnv = apply_defaults(os_env(), DefaultEnv) ++ OverrideEnv,
|
||||||
expand_vars_loop(merge_each_var(RawEnv, [])).
|
expand_vars_loop(merge_each_var(RawEnv, [])).
|
||||||
|
|
||||||
global_defines(Config) ->
|
get_defines(Config) ->
|
||||||
Defines = rebar_config:get_global(Config, defines, []),
|
RawDefines = rebar_config:get_xconf(Config, defines, []),
|
||||||
Flags = string:join(["-D" ++ D || D <- Defines], " "),
|
Defines = string:join(["-D" ++ D || D <- RawDefines], " "),
|
||||||
[{"ERL_CFLAGS", "$ERL_CFLAGS " ++ Flags}].
|
[{"ERL_CFLAGS", "$ERL_CFLAGS " ++ Defines}].
|
||||||
|
|
||||||
replace_extension(File, NewExt) ->
|
replace_extension(File, NewExt) ->
|
||||||
OldExt = filename:extension(File),
|
OldExt = filename:extension(File),
|
||||||
|
|
|
@ -291,9 +291,9 @@ delayed_halt(Code) ->
|
||||||
-spec erl_opts(rebar_config:config()) -> list().
|
-spec erl_opts(rebar_config:config()) -> list().
|
||||||
erl_opts(Config) ->
|
erl_opts(Config) ->
|
||||||
RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []),
|
RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []),
|
||||||
GlobalDefines = [{d, list_to_atom(D)} ||
|
Defines = [{d, list_to_atom(D)} ||
|
||||||
D <- rebar_config:get_global(Config, defines, [])],
|
D <- rebar_config:get_xconf(Config, defines, [])],
|
||||||
Opts = GlobalDefines ++ RawErlOpts,
|
Opts = Defines ++ RawErlOpts,
|
||||||
case proplists:is_defined(no_debug_info, Opts) of
|
case proplists:is_defined(no_debug_info, Opts) of
|
||||||
true ->
|
true ->
|
||||||
[O || O <- Opts, O =/= no_debug_info];
|
[O || O <- Opts, O =/= no_debug_info];
|
||||||
|
|
Loading…
Reference in a new issue