View Source Bundlex.Native (Bundlex v1.2.0)

Module responsible for parsing and processing natives' configurations.

Summary

Functions

Parses natives and generates compiler commands.

Types

@type interface_t() :: :nif | :cnode | :port
@type language_t() :: :c | :cpp
@type lib_name() :: String.t()
@type name_t() :: atom()
@type os_dep() :: {os_dep_provider() | [os_dep_provider()], lib_name() | [lib_name()]}
@type os_dep_provider() ::
  :pkg_config | {:precompiled, precompiled_dependency_url()} | nil
Link to this type

precompiled_dependency_url()

View Source
@type precompiled_dependency_url() :: String.t()
@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(),
  os_deps: [os_dep()],
  pkg_configs: [String.t()],
  preprocessors: [Bundlex.Project.Preprocessor.t()],
  sources: [String.t()],
  type: :native | :lib
}

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.