build: add EMQX_ENTERPRISE compile flag

This commit is contained in:
Zaiming (Stone) Shi 2022-01-25 14:29:35 +01:00
parent f3fe3db771
commit b9e507110c
2 changed files with 11 additions and 9 deletions

View File

@ -85,8 +85,8 @@ version() ->
Vsn
end.
build_vsn() ->
case edition() of
ee -> ?EMQX_RELEASE_EE;
_ -> ?EMQX_RELEASE_CE
end.
-ifdef(EMQX_ENTERPRISE).
build_vsn() -> ?EMQX_RELEASE_EE.
-else.
build_vsn() -> ?EMQX_RELEASE_CE.
-endif.

View File

@ -151,15 +151,16 @@ profiles_ce() ->
profiles_ee() ->
Vsn = get_vsn('emqx-enterprise'),
EE = {d, 'EMQX_ENTERPRISE'},
[ {'emqx-enterprise',
[ {erl_opts, prod_compile_opts(Vsn)}
[ {erl_opts, [EE | prod_compile_opts(Vsn)]}
, {relx, relx(Vsn, cloud, bin, ee)}
, {overrides, prod_overrides()}
, {project_app_dirs, project_app_dirs(ee)}
, {post_hooks, [{compile, "bash build emqx-enterprise doc"}]}
]}
, {'emqx-enterprise-pkg',
[ {erl_opts, prod_compile_opts(Vsn)}
[ {erl_opts, [EE | prod_compile_opts(Vsn)]}
, {relx, relx(Vsn, cloud, pkg, ee)}
, {overrides, prod_overrides()}
, {project_app_dirs, project_app_dirs(ee)}
@ -170,13 +171,14 @@ profiles_ee() ->
%% EE has more files than CE, always test/check with EE options.
profiles_dev() ->
Vsn = get_vsn('emqx-enterprise'),
EE = {d, 'EMQX_ENTERPRISE'},
[ {check,
[ {erl_opts, common_compile_opts(Vsn)}
[ {erl_opts, [EE | common_compile_opts(Vsn)]}
, {project_app_dirs, project_app_dirs(ee)}
]}
, {test,
[ {deps, test_deps()}
, {erl_opts, common_compile_opts(Vsn) ++ erl_opts_i()}
, {erl_opts, [EE | common_compile_opts(Vsn) ++ erl_opts_i()]}
, {extra_src_dirs, [{"test", [{recursive, true}]}]}
, {project_app_dirs, project_app_dirs(ee)}
]}