View Source Bundlex.Native (Bundlex v1.0.0)

Module responsible for parsing and processing natives' configurations.

Link to this section Summary

Functions

Parses natives and generates compiler commands.

Link to this section Types

@type interface_t() :: :nif | :cnode | :port
@type language_t() :: :c | :cpp
@type name_t() :: atom()
@type t() :: %Bundlex.Native{
  app: Application.app(),
  compiler_flags: [String.t()],
  deps: [t()],
  includes: [String.t()],
  interface: interface_t() | nil,
  language: language_t(),
  lib_dirs: [String.t()],
  libs: [String.t()],
  linker_flags: [String.t()],
  name: atom(),
  pkg_configs: [String.t()],
  preprocessors: [Bundlex.Project.Preprocessor.t()],
  sources: [String.t()],
  type: :native | :lib
}

Link to this section Functions

Link to this function

resolve_natives(project, platform)

View Source
@spec resolve_natives(Bundlex.Project.t(), Bundlex.platform_t()) ::
  {:ok, compiler_commands :: [String.t()]}
  | {:error,
     {application :: atom(),
      {:unknown_fields, [field :: atom()]}
      | {:no_sources_in_native, native_name :: atom()}
      | :invalid_project_specification
      | {:no_bundlex_project_in_file, path :: binary()}
      | :unknown_application}}

Parses natives and generates compiler commands.