-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
660 additions
and
727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
defmodule Zig.C do | ||
@moduledoc false | ||
|
||
# module creates a struct that defines the options for | ||
# c-interoperability with zigler | ||
|
||
defstruct include_dirs: [], | ||
src: [], | ||
link_lib: [], | ||
link_libcpp: false | ||
|
||
@type t :: %__MODULE__{ | ||
include_dirs: [Path.t()], | ||
link_lib: [Path.t()], | ||
link_libcpp: boolean, | ||
src: src_opts() | ||
} | ||
|
||
@type opts :: [ | ||
include_dirs: Path.t() | [Path.t()], | ||
link_lib: Path.t() | [Path.t()], | ||
link_libcpp: boolean, | ||
src: src_opts() | ||
] | ||
|
||
@type src_opts :: term | ||
|
||
def new(opts) do | ||
struct!(__MODULE__, | ||
include_dirs: List.wrap(opts[:include_dirs]), | ||
link_lib: List.wrap(opts[:link_lib]) | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.