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 Vsn
end. end.
build_vsn() -> -ifdef(EMQX_ENTERPRISE).
case edition() of build_vsn() -> ?EMQX_RELEASE_EE.
ee -> ?EMQX_RELEASE_EE; -else.
_ -> ?EMQX_RELEASE_CE build_vsn() -> ?EMQX_RELEASE_CE.
end. -endif.

View File

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