mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 19:39:03 +08:00
Initial work for G-code sender and more intensive usage of Boost
This commit is contained in:
parent
43cbad8867
commit
11dd67ab34
1
Build.PL
1
Build.PL
@ -7,6 +7,7 @@ use Config;
|
|||||||
use File::Spec;
|
use File::Spec;
|
||||||
|
|
||||||
my %prereqs = qw(
|
my %prereqs = qw(
|
||||||
|
Devel::CheckLib 0
|
||||||
Encode::Locale 0
|
Encode::Locale 0
|
||||||
ExtUtils::MakeMaker 6.80
|
ExtUtils::MakeMaker 6.80
|
||||||
ExtUtils::ParseXS 3.22
|
ExtUtils::ParseXS 3.22
|
||||||
|
26
utils/send-gcode.pl
Normal file
26
utils/send-gcode.pl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
use FindBin;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
}
|
||||||
|
|
||||||
|
use Slic3r;
|
||||||
|
|
||||||
|
my $serial = Slic3r::GCode::Sender->new($ARGV[0], $ARGV[1]);
|
||||||
|
|
||||||
|
$serial->send($ARGV[2]);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
$serial->send("1");
|
||||||
|
sleep 1;
|
||||||
|
$serial->send("0");
|
||||||
|
sleep 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
__END__
|
37
xs/Build.PL
37
xs/Build.PL
@ -3,6 +3,7 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use Devel::CheckLib;
|
||||||
use ExtUtils::CppGuess;
|
use ExtUtils::CppGuess;
|
||||||
use Module::Build::WithXSpp;
|
use Module::Build::WithXSpp;
|
||||||
|
|
||||||
@ -10,6 +11,39 @@ use Module::Build::WithXSpp;
|
|||||||
# HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC
|
# HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC
|
||||||
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
||||||
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS);
|
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS);
|
||||||
|
|
||||||
|
my @INC = qw();
|
||||||
|
my @LIBS = qw();
|
||||||
|
|
||||||
|
if (defined $ENV{BOOST_DIR}) {
|
||||||
|
if (-d "$ENV{BOOST_DIR}/include") {
|
||||||
|
push @INC, '-I' . $ENV{BOOST_DIR} . '/include';
|
||||||
|
} else {
|
||||||
|
push @INC, '-I' . $ENV{BOOST_DIR};
|
||||||
|
}
|
||||||
|
push @LIBS, '-L' . $ENV{BOOST_DIR};
|
||||||
|
} else {
|
||||||
|
push @INC, map "-I$_", grep { -d $_ }
|
||||||
|
qw(/opt/local/include /usr/local/include /opt/include),
|
||||||
|
qw(/usr/include C:/Boost/include);
|
||||||
|
push @LIBS, map "-L$_", grep { -d $_ }
|
||||||
|
qw(/opt/local/lib /usr/local/lib /opt/lib /usr/lib),
|
||||||
|
qw(C:/Boost/lib /lib);
|
||||||
|
}
|
||||||
|
|
||||||
|
push @INC, '-Iinclude';
|
||||||
|
|
||||||
|
my @boost_libs = qw(thread system);
|
||||||
|
for my $pattern ('boost_%s', 'boost_%s-mt') {
|
||||||
|
check_lib(
|
||||||
|
lib => sprintf($pattern, 'system'),
|
||||||
|
INC => join(' ', @INC),
|
||||||
|
LIBS => join(' ', @LIBS),
|
||||||
|
) or next;
|
||||||
|
push @LIBS, map sprintf("-l$pattern", $_), @boost_libs;
|
||||||
|
push @cflags, '-DBOOST_LIBS';
|
||||||
|
last;
|
||||||
|
}
|
||||||
if ($ENV{SLIC3R_DEBUG}) {
|
if ($ENV{SLIC3R_DEBUG}) {
|
||||||
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
||||||
push @cflags, qw(-DSLIC3R_DEBUG -g);
|
push @cflags, qw(-DSLIC3R_DEBUG -g);
|
||||||
@ -40,7 +74,8 @@ my $build = Module::Build::WithXSpp->new(
|
|||||||
Module::Build 0.38
|
Module::Build 0.38
|
||||||
Module::Build::WithXSpp 0.13
|
Module::Build::WithXSpp 0.13
|
||||||
)},
|
)},
|
||||||
extra_compiler_flags => \@cflags,
|
extra_compiler_flags => [ @INC, @cflags ],
|
||||||
|
extra_linker_flags => \@LIBS,
|
||||||
|
|
||||||
# Provides extra C typemaps that are auto-merged
|
# Provides extra C typemaps that are auto-merged
|
||||||
extra_typemap_modules => {
|
extra_typemap_modules => {
|
||||||
|
3303
xs/MANIFEST
3303
xs/MANIFEST
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user