build: workaround for windows build
This commit is contained in:
parent
96a510fbf1
commit
45e2605485
|
|
@ -13,26 +13,34 @@ IsWin32 = fun() ->
|
||||||
end,
|
end,
|
||||||
|
|
||||||
IsMacOS = fun() ->
|
IsMacOS = fun() ->
|
||||||
{unix, darwin} =:= os:type()
|
{unix, darwin} =:= os:type()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
IsQuicSupp = fun() ->
|
IsQuicSupp = fun() ->
|
||||||
not (IsCentos6() orelse IsWin32()
|
not (IsCentos6() orelse IsWin32() orelse
|
||||||
orelse IsMacOS() orelse
|
IsMacOS() orelse
|
||||||
false =/= os:getenv("BUILD_WITHOUT_QUIC")
|
false =/= os:getenv("BUILD_WITHOUT_QUIC")) orelse
|
||||||
)
|
"1" == os:getenv("BUILD_WITH_QUIC")
|
||||||
orelse "1" == os:getenv("BUILD_WITH_QUIC")
|
end,
|
||||||
end,
|
|
||||||
|
|
||||||
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
|
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
|
||||||
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.11"}}}.
|
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.11"}}}.
|
||||||
|
|
||||||
ExtraDeps = fun(C) ->
|
ExtraDeps = fun(C) ->
|
||||||
{deps, Deps0} = lists:keyfind(deps, 1, C),
|
{deps, Deps0} = lists:keyfind(deps, 1, C),
|
||||||
Deps =
|
{erl_opts, ErlOpts0} = lists:keyfind(erl_opts, 1, C),
|
||||||
Deps0 ++ [Bcrypt || not IsWin32()] ++
|
IsQuic = IsQuicSupp(),
|
||||||
[Quicer || IsQuicSupp()],
|
New = [
|
||||||
lists:keystore(deps, 1, C, {deps, Deps})
|
{deps, Deps0 ++ [Bcrypt || not IsWin32()] ++ [Quicer || IsQuic]},
|
||||||
|
{erl_opts, ErlOpts0 ++ [{d, 'BUILD_WITHOUT_QUIC'} || not IsQuic]}
|
||||||
|
],
|
||||||
|
lists:foldl(
|
||||||
|
fun({Key, _Val} = KV, Acc) ->
|
||||||
|
lists:keystore(Key, 1, Acc, KV)
|
||||||
|
end,
|
||||||
|
C,
|
||||||
|
New
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
ExtraDeps(CONFIG).
|
ExtraDeps(CONFIG).
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,12 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
-module(emqx_quic_connection).
|
-module(emqx_quic_connection).
|
||||||
|
|
||||||
|
-ifndef(BUILD_WITHOUT_QUIC).
|
||||||
-include_lib("quicer/include/quicer.hrl").
|
-include_lib("quicer/include/quicer.hrl").
|
||||||
|
-else.
|
||||||
|
-define(QUIC_CONNECTION_SHUTDOWN_FLAG_NONE, 0).
|
||||||
|
-endif.
|
||||||
|
|
||||||
%% Callbacks
|
%% Callbacks
|
||||||
-export([
|
-export([
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
%% MQTT/QUIC Stream
|
%% MQTT/QUIC Stream
|
||||||
-module(emqx_quic_stream).
|
-module(emqx_quic_stream).
|
||||||
-include_lib("quicer/include/quicer.hrl").
|
|
||||||
|
|
||||||
%% emqx transport Callbacks
|
%% emqx transport Callbacks
|
||||||
-export([
|
-export([
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
%% eredis_cluster's dependency getting resolved earlier.
|
%% eredis_cluster's dependency getting resolved earlier.
|
||||||
%% Here we pin 1.5.2 to avoid surprises in the future.
|
%% Here we pin 1.5.2 to avoid surprises in the future.
|
||||||
{poolboy, {git, "https://github.com/emqx/poolboy.git", {tag, "1.5.2"}}},
|
{poolboy, {git, "https://github.com/emqx/poolboy.git", {tag, "1.5.2"}}},
|
||||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.5.1"}}}
|
{emqtt, {git, "https://github.com/qzhuyan/emqtt", {branch, "dev/william/bump-quicer"}}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{shell, [
|
{shell, [
|
||||||
|
|
|
||||||
3
mix.exs
3
mix.exs
|
|
@ -58,7 +58,8 @@ defmodule EMQXUmbrella.MixProject do
|
||||||
{:ecpool, github: "emqx/ecpool", tag: "0.5.2"},
|
{:ecpool, github: "emqx/ecpool", tag: "0.5.2"},
|
||||||
{:replayq, "0.3.4", override: true},
|
{:replayq, "0.3.4", override: true},
|
||||||
{:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true},
|
{:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true},
|
||||||
{:emqtt, github: "emqx/emqtt", tag: "1.5.1", override: true},
|
# {:emqtt, github: "emqx/emqtt", tag: "1.5.1", override: true},
|
||||||
|
{:emqtt, github: "qzhuyan/emqtt", branch: "dev/william/bump-quicer", override: true},
|
||||||
{:rulesql, github: "emqx/rulesql", tag: "0.1.4"},
|
{:rulesql, github: "emqx/rulesql", tag: "0.1.4"},
|
||||||
{:observer_cli, "1.7.1"},
|
{:observer_cli, "1.7.1"},
|
||||||
{:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.3"},
|
{:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.3"},
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,8 @@ common_compile_opts(Edition, Vsn) ->
|
||||||
{compile_info, [{emqx_vsn, Vsn}]},
|
{compile_info, [{emqx_vsn, Vsn}]},
|
||||||
{d, 'EMQX_RELEASE_EDITION', Edition}
|
{d, 'EMQX_RELEASE_EDITION', Edition}
|
||||||
] ++
|
] ++
|
||||||
[{d, 'EMQX_BENCHMARK'} || os:getenv("EMQX_BENCHMARK") =:= "1"].
|
[{d, 'EMQX_BENCHMARK'} || os:getenv("EMQX_BENCHMARK") =:= "1"] ++
|
||||||
|
[{d, 'BUILD_WITHOUT_QUIC'} || not is_quicer_supported()].
|
||||||
|
|
||||||
prod_compile_opts(Edition, Vsn) ->
|
prod_compile_opts(Edition, Vsn) ->
|
||||||
[
|
[
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue