aboutsummaryrefslogtreecommitdiffstats
path: root/core/compat.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/compat.mk')
-rw-r--r--core/compat.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/compat.mk b/core/compat.mk
index bdf9a90..f936768 100644
--- a/core/compat.mk
+++ b/core/compat.mk
@@ -6,7 +6,9 @@
# We strip out -Werror because we don't want to fail due to
# warnings when used as a dependency.
-define compat_convert_erlc_opt
+compat_prepare_erlc_opts = $(shell echo "$1" | sed 's/, */,/')
+
+define compat_convert_erlc_opts
$(if $(filter-out -Werror,$1),\
$(if $(findstring +,$1),\
$(shell echo $1 | cut -b 2-)))
@@ -15,7 +17,8 @@ endef
define compat_rebar_config
{deps, [$(call comma_list,$(foreach d,$(DEPS),\
{$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}.
-{erl_opts, [$(call comma_list,$(foreach o,$(ERLC_OPTS),$(call compat_convert_erlc_opt,$o)))]}.
+{erl_opts, [$(call comma_list,$(foreach o,$(call compat_prepare_erlc_opts,$(ERLC_OPTS)),\
+ $(call compat_convert_erlc_opts,$o)))]}.
endef
$(eval _compat_rebar_config = $$(compat_rebar_config))