Browse Source

mad compile_options sys.config variable

Namdak Tonpa 6 years ago
parent
commit
36d943543e
3 changed files with 4 additions and 3 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 3 2
      src/compile/mad_erl.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"73b138").
+-define(VERSION,"608216").

BIN
mad


+ 3 - 2
src/compile/mad_erl.erl

@@ -2,9 +2,10 @@
 -copyright('Sina Samavati').
 -copyright('Sina Samavati').
 -compile(export_all).
 -compile(export_all).
 -define(COMPILE_OPTS(Inc, Ebin, Opts, Deps),
 -define(COMPILE_OPTS(Inc, Ebin, Opts, Deps),
-    [return_errors, return_warnings, debug_info, nowarn_export_all,
-    {i, [Inc]}, {outdir, Ebin}] ++ Opts ++ Deps).
+    compile_options() ++ [{i, [Inc]}, {outdir, Ebin}] ++ Opts ++ Deps).
 
 
+compile_options() -> application:get_env(mad,compile_options,
+    [return_errors, return_warnings, debug_info, nowarn_export_all]).
 erl_to_beam(Bin, F) -> filename:join(Bin, filename:basename(F, ".erl") ++ ".beam").
 erl_to_beam(Bin, F) -> filename:join(Bin, filename:basename(F, ".erl") ++ ".beam").
 
 
 filter(I) -> [ X || X <- I, X /= warnings_as_errors, X /= warn_export_all, X /=warn_unused_import] .
 filter(I) -> [ X || X <- I, X /= warnings_as_errors, X /= warn_export_all, X /=warn_unused_import] .