~ubuntu-branches/ubuntu/utopic/slic3r/utopic

« back to all changes in this revision

Viewing changes to xs/Build.PL

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use ExtUtils::CppGuess;
 
7
use Module::Build::WithXSpp;
 
8
 
 
9
# _GLIBCXX_USE_C99 : to get the long long type for g++
 
10
# HAS_BOOL         : stops Perl/lib/CORE/handy.h from doing "#  define bool char" for MSVC
 
11
# NOGDI            : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
 
12
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS);
 
13
if ($ENV{SLIC3R_DEBUG}) {
 
14
    # only on newer GCCs: -ftemplate-backtrace-limit=0
 
15
    push @cflags, qw(-DSLIC3R_DEBUG -g);
 
16
}
 
17
if (ExtUtils::CppGuess->new->is_gcc) {
 
18
    # check whether we're dealing with a buggy GCC version
 
19
    # see https://github.com/alexrj/Slic3r/issues/1965
 
20
    if (`cc --version` =~ / 4\.7\.[012]/) {
 
21
        # Workaround suggested by Boost devs:
 
22
        # https://svn.boost.org/trac/boost/ticket/8695
 
23
        push @cflags, qw(-fno-inline-small-functions);
 
24
    }
 
25
}
 
26
 
 
27
my $build = Module::Build::WithXSpp->new(
 
28
    module_name     => 'Slic3r::XS',
 
29
    dist_abstract   => 'XS code for Slic3r',
 
30
    build_requires => {qw(
 
31
        ExtUtils::ParseXS           3.18
 
32
        ExtUtils::Typemap           1.00
 
33
        ExtUtils::Typemaps::Default 1.03
 
34
        ExtUtils::XSpp              0.17
 
35
        Module::Build               0.3601
 
36
        Test::More                  0
 
37
    )},
 
38
    configure_requires => {qw(
 
39
        ExtUtils::CppGuess          0.07
 
40
        Module::Build               0.38
 
41
        Module::Build::WithXSpp     0.13
 
42
    )},
 
43
    extra_compiler_flags => \@cflags,
 
44
    
 
45
    # Provides extra C typemaps that are auto-merged
 
46
    extra_typemap_modules => {
 
47
        'ExtUtils::Typemaps::Default' => '1.03',
 
48
    },
 
49
    
 
50
    # for MSVC builds
 
51
    early_includes => [qw(
 
52
        cstring
 
53
        cstdlib
 
54
        ostream
 
55
                sstream
 
56
    )]
 
57
);
 
58
 
 
59
$build->create_build_script;
 
60
 
 
61
__END__