Alien-ProtoBuf

 view release on metacpan or  search on metacpan

inc/AP/Build.pm  view on Meta::CPAN

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use strict;
 
 
sub new {
    my $class = shift;
    my $self = $class->SUPER::new(
        @_,
        alien_name            => 'protobuf',
    );
 
    if (!$self->alien_check_installed_version) {
        # this should get us an "NA"
        warn "Could not find an installed protobuf library";
        exit 0;
    }
 
    return $self;
}
 
sub alien_provides_cflags {
    my $self = shift;
    my $cflags = $self->SUPER::alien_provides_cflags || '';
    if ($^O eq 'freebsd' && $cflags !~ m{/usr/local/include}) {
        $cflags = "$cflags -I/usr/local/include";
    }
    return $cflags;
}
 
sub ACTION_alien_code {
    my $self = shift;
    $self->SUPER::ACTION_alien_code();
    my $system_provides = scalar $self->config_data('system_provides');
 
    my $version = $self->alien_check_installed_version;
    my ($major, $minor) = split /\./, $version;
    if ($major > 3 || ($major == 3 && $minor >= 6)) {
        if (!ExtUtils::CppGuess->new->is_msvc) {
            $system_provides->{'C++flags'} = "-std=c++11";
        }
    }
}



( run in 0.304 second using v1.01-cache-2.11-cpan-cba739cd03b )