Dist::Build::XS::WriteConstants(3pm)

Dist::Build::XS::WriteConstants3pm

Dist::build extension integrating extutils::constant

Usage

 load_extension('Dist::Build::XS');
 load_extension('Dist::Build::XS::WriteConstants');
 add_xs(
     module          => 'Foo::Bar',
     write_constants => {
         NAMES => [ qw/FOO BAR BAZ/ ],
     },
 );

Version

version 0.020

Overview

This module is an extension of Dist::Build::XS, adding an additional argument to the "add_xs" function: "write_constants". This hash will take the same members as the "WriteConstants" function of ExtUtils::Constant, except that it will set sensible default values for the "NAME" (based on the module's name), "C_FILE" and "XS_FILE" (based on the XS file's directory and "CONST_BASENAME" defaulting to 'const') members so usually those will not need to be passed. So the above example is equivalent to

  {
    NAME    => 'Foo::Bar',
    NAMES   => [ qw/FOO BAR BAZ/ ],
    C_FILE  => 'lib/Foo/const-c.inc',
    XS_FILE => 'lib/Foo/const-xs.inc',
  }

Author

Leon Timmermans <[email protected]>

From libdist-build-perl 0.020-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.