【问题标题】:Exclude module from compilation in rebar3从 rebar3 中的编译中排除模块
【发布时间】:2018-01-27 23:29:44
【问题描述】:

如何从 rebar3 的编译中排除 Erlang 模块?

应根据配置文件包含或排除。

【问题讨论】:

    标签: erlang rebar3


    【解决方案1】:

    解决方案是在 rebar.config 中添加定义宏的 rebar3 配置文件

    {profiles, [{nomodulex, [
        {erl_opts, [{d, 'NO_MODX'}]}
        ]}
    ]}.
    

    并且在模块中直接在模块声明之后添加 -ifndef(NO_MODX). 最后 -endif.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多