Skip to content

Commit

Permalink
add compile-time guard
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Aug 1, 2023
1 parent adf7d08 commit b8d1081
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 202 deletions.
2 changes: 2 additions & 0 deletions lib/evision/backend.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if Code.ensure_loaded?(Evision) do
defmodule Evision.Backend do
@behaviour Nx.Backend
defstruct [:ref]
Expand Down Expand Up @@ -822,3 +823,4 @@ defmodule Evision.Backend do
end
end
end
end
2 changes: 2 additions & 0 deletions lib/evision_highgui.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if Code.ensure_loaded?(Evision) do
defmodule Evision.HighGui do
@moduledoc """
High-level Graphical User Interface
Expand Down Expand Up @@ -76,3 +77,4 @@ defmodule Evision.HighGui do
:evision_nif.destroyAllWindows()
end
end
end
2 changes: 2 additions & 0 deletions lib/evision_mat.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if Code.ensure_loaded?(Evision) do
defmodule Evision.Mat do
@moduledoc """
Evision Mat
Expand Down Expand Up @@ -2163,3 +2164,4 @@ defmodule Evision.Mat do
|> Evision.Internal.Structurise.to_struct()
end
end
end
2 changes: 2 additions & 0 deletions lib/evision_structurise.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if Code.ensure_loaded?(Evision) do
defmodule Evision.Internal.Structurise do
@moduledoc false

Expand Down Expand Up @@ -85,3 +86,4 @@ defmodule Evision.Internal.Structurise do
@spec from_struct(term()) :: term()
def from_struct(pass_through), do: pass_through
end
end
2 changes: 2 additions & 0 deletions lib/evision_wx.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if Code.ensure_loaded?(Evision) do
defmodule Evision.Wx do
@moduledoc """
Interact with wxWidgets
Expand Down Expand Up @@ -238,3 +239,4 @@ defmodule Evision.Wx do
:ok
end
end
end
Loading

0 comments on commit b8d1081

Please sign in to comment.