How to compile c / C ++ code from :: Build module for perl module?

In this question about creating a new perl module, it was suggested to use Module :: Create for any new packages.

I cannot find examples with Module :: Build, which also compile c / C ++ code.

I find it amazing, so it really is a goto package for future development. Am I just blind?

+1
source share
1 answer

This question is dated, and the level of unbridled enthusiasm that Brian demonstrates for Module :: Build is not really justified - it works, and may be better for your situation, but it has its own share of problems and currently receives only limited service .

But to answer your specific question: if you have XS files, all you have to do is put the .xs files at the top level of your distribution and they will be built without the need to specify a module :: Create something.

If you have additional .c or .h files (including Devel :: PPPort ppport.h ) that should be created with your module, put them in a directory and specify this directory as c_source for the new constructor from the :: Build module.

+6
source

Source: https://habr.com/ru/post/973049/


All Articles