logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Dist::Build::XS::WriteConstants - Dist::Build extension integrating ExtUtils::Constant

Author

       Leon Timmermans <fawaka@gmail.com>

Description

       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',
         }

Name

       Dist::Build::XS::WriteConstants - Dist::Build extension integrating ExtUtils::Constant

Synopsis

        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

See Also