Module build.toolchain

Common interface for build toolchains.

This module returns build.toolchain.gnu or build.toolchain.msvc based on the user's platform.

Functions

compile_object (vars, obj_file, source_file, defines, incdirs) Compiles the source_file into the object file obj_file.
create_static_lib (vars, out_file, objects) Creates a static library (archive).
create_shared_lib (vars, so_file, objects, libs, libdirs) Creates a shared library.
link_binary (vars, out_file, objects, libs, libdirs) Creates an executable binary.
strip (vars, bin_file) Strips debugging symbols from the specified binary file.


Functions

compile_object (vars, obj_file, source_file, defines, incdirs)
Compiles the source_file into the object file obj_file.

Parameters:

  • vars optional table Table of variables.
  • obj_file string Name of the object file being created.
  • source_file string Path of the source file to compile.
  • defines optional {string,...} List of definitions; each will be prepended with -D, variables substituted and passed to compiler.
  • incdirs optional {string,...} List of include directories; each will be prepended with -I, variables substituted and passed to compiler.

Returns:

    bool true on success, false on failure.
create_static_lib (vars, out_file, objects)
Creates a static library (archive).

Parameters:

  • vars optional table Table of variables.
  • out_file string Name of the output file being created.
  • objects {string,...} List of paths of the object files to pack into archive.

Returns:

    bool true on success, false on failure.
create_shared_lib (vars, so_file, objects, libs, libdirs)
Creates a shared library.

Parameters:

  • vars optional table Table of variables.
  • so_file string Name of the shared object file being created.
  • objects {string,...} List of paths of the object files to pack into shared object.
  • libs optional {string,...} List of libraries to link against; each will be prepended with -l, variables substituted and passed to linker.
  • libdirs optional {string,...} List of directories where to search for libraries; each will be prepended with -L, variables substituted and passed to linker.

Returns:

    bool true on success, false on failure.
link_binary (vars, out_file, objects, libs, libdirs)
Creates an executable binary.

Parameters:

  • vars optional table Table of variables.
  • out_file string Name of the binary being created.
  • objects {string,...} List of paths of the object files to pack into the binary.
  • libs optional {string,...} List of libraries to link against; each will be prepended with -l, variables substituted and passed to linker.
  • libdirs optional {string,...} List of directories where to search for libraries; each will be prepended with -L, variables substituted and passed to linker.

Returns:

    bool true on success, false on failure.
strip (vars, bin_file)
Strips debugging symbols from the specified binary file.

Parameters:

  • vars optional table Table of variables.
  • bin_file string Name of the binary file to strip.

Returns:

    bool true on success, false on failure.
generated by LDoc 1.4.6