Alien-Kiwisolver

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.003 2021-05-31 19:53:43-0400

  - No change from v0.002_003.

0.002_003 2021-05-30 13:09:53-0400

  Bug fixes

   - Use C++ standard flag from ExtUtils::CppGuess to determine if C++
     compiler has support for C++11.

     See <https://github.com/Intertangle/p5-Alien-Kiwisolver/pull/9>,
     <https://github.com/tsee/extutils-cppguess/pull/24>.

0.002_002 2021-05-05 19:58:56-0400

  Bug fixes

   - C++ headers: Avoid Perl's "seed" macro that breaks <algorithm> by

alienfile  view on Meta::CPAN

use alienfile;

use strict;
use warnings;

use ExtUtils::CppGuess;

my $guess = ExtUtils::CppGuess->new;
my $cppstdflag = $guess->cpp_standard_flag('C++11');

die "Need to have full C++11 support, compiler @{[ (split ' ', $guess->compiler_command)[0] ]} only supports $cppstdflag"
	if ( $guess->is_gcc || $guess->is_clang ) && $cppstdflag =~ /\Qc++0x\E/;

share {
	requires 'Net::SSLeay' => 0;
	requires 'IO::Socket::SSL' => 0;
	requires 'File::Copy::Recursive' => 0;
	requires 'Path::Tiny' => 0;

	plugin Download => (
		url => 'https://github.com/nucleic/kiwi/archive/main.zip',
	);

alienfile  view on Meta::CPAN

			$kiwi_include_dest->mkpath;

			File::Copy::Recursive::dircopy( 'kiwi', $kiwi_include_dest->child('kiwi') );
		},
	];

	gather sub {
		my($build) = @_;
		my $prefix = $build->runtime_prop->{prefix};

		my $cflags = "-I$prefix/include";
		my $libs = "";

		$build->runtime_prop->{cppstdflag}    = $cppstdflag;
		$build->runtime_prop->{cflags}        = $cflags;
		$build->runtime_prop->{cflags_static} = $cflags;
		$build->runtime_prop->{libs}          = $libs;
		$build->runtime_prop->{libs_static}   = $libs;
	};
};

lib/Alien/Kiwisolver.pm  view on Meta::CPAN

sub inline_auto_include {
	return  [ 'kiwi/kiwi.h' ];
}

sub Inline {
	my ($self, $lang) = @_;

	if( $lang =~ /^CPP$/ ) {
		my $params = Alien::Base::Inline(@_);

		$params->{CCFLAGSEX} = $self->runtime_prop->{cppstdflag};

		$params->{PRE_HEAD} = <<'		EOF';
		#if defined(_MSC_VER) || defined(__MINGW32__)
		#  define NO_XSLOCKS /* To avoid Perl wrappers of C library */
		#endif

		#ifdef __cplusplus
			// Avoid Perl's "seed" macro that breaks <algorithm> by including <algorithm> first.
			#include <algorithm>
		#endif



( run in 0.263 second using v1.01-cache-2.11-cpan-94b05bcf43c )