Link boost & intel Thread Building Blocks statically by default

on Windows and OSX, dynamically on Linux.
This could be overidden by an environment variable
SLIC3R_DYNAMIC=1
This commit is contained in:
bubnikv 2017-03-23 15:06:22 +01:00
parent a7838cac07
commit b7d3ed26c6

View file

@ -7,6 +7,9 @@ use Devel::CheckLib;
use ExtUtils::CppGuess; use ExtUtils::CppGuess;
use Module::Build::WithXSpp; use Module::Build::WithXSpp;
# Link boost & TBB statically by default on Windows & OSX.
$ENV{SLIC3R_STATIC} = 1 if ($^O eq 'MSWin32' || $^O eq 'darwin') && (! defined($ENV{SLIC3R_DYNAMIC}) || $ENV{SLIC3R_DYNAMIC} != 1);
my $cpp_guess = ExtUtils::CppGuess->new; my $cpp_guess = ExtUtils::CppGuess->new;
my $mswin = $^O eq 'MSWin32'; my $mswin = $^O eq 'MSWin32';
my $lib_ext = $ENV{SLIC3R_STATIC} ? ($cpp_guess->is_msvc ? '.lib' : '.a') : ${$cpp_guess}{config}{lib_ext}; my $lib_ext = $ENV{SLIC3R_STATIC} ? ($cpp_guess->is_msvc ? '.lib' : '.a') : ${$cpp_guess}{config}{lib_ext};
@ -43,7 +46,7 @@ my @early_includes = ();
my @INC = qw(-Isrc/libslic3r -Isrc/glew/include); my @INC = qw(-Isrc/libslic3r -Isrc/glew/include);
my @LIBS = $cpp_guess->is_msvc ? qw(-LIBPATH:src/libslic3r) : qw(-Lsrc/libslic3r); my @LIBS = $cpp_guess->is_msvc ? qw(-LIBPATH:src/libslic3r) : qw(-Lsrc/libslic3r);
$ENV{SLIC3R_GUI} = 1 if $ENV{SLIC3R_NOGUI} != 1; $ENV{SLIC3R_GUI} = 1 if ! defined($ENV{SLIC3R_NOGUI}) || $ENV{SLIC3R_NOGUI} != 1;
if ($ENV{SLIC3R_GUI} || $ENV{SLIC3R_PRUS}) if ($ENV{SLIC3R_GUI} || $ENV{SLIC3R_PRUS})
{ {