diff --git a/xs/Build.PL b/xs/Build.PL index 9578efc904..f35379bed9 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -47,17 +47,16 @@ if (defined $ENV{BOOST_DIR}) { # In order to generate the -l switches we need to know how Boost libraries are named my $have_boost = 0; +my @boost_libraries = qw(system thread); # we need these # check without explicit lib path (works on Linux) $have_boost = 1 if check_lib( - lib => "boost_system", - INC => join(' ', map "-I$_", @INC, @boost_include), - LIBS => join(' ', map "-L$_", @INC, @boost_libs), + lib => [ map "boost_${_}", @boost_libraries ], ); if ($have_boost) { - push @LIBS, '-lboost_system', '-lboost_thread'; + push @LIBS, map "-l$_", @boost_libraries; } else { foreach my $path (@boost_libs) { my @files = glob "$path/libboost_system*"; @@ -66,13 +65,13 @@ if ($have_boost) { if ($files[0] =~ /libboost_system([^.]+)/) { my $suffix = $1; check_lib( - lib => "boost_system$suffix", + lib => [ map "boost_${_}${suffix}", @boost_libraries ], INC => join(' ', map "-I$_", @INC, @boost_include), LIBS => "-L$path", ) or next; push @INC, (map " -I$_", @boost_include); # TODO: only use the one related to the chosen lib path - push @LIBS, " -L$path", (map " -lboost_$_$suffix", qw(thread system)); # we need these + push @LIBS, " -L$path", (map " -lboost_$_$suffix", @boost_libraries); $have_boost = 1; last; } diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp index 01da5945dc..9237535e25 100644 --- a/xs/src/libslic3r/Config.hpp +++ b/xs/src/libslic3r/Config.hpp @@ -74,8 +74,8 @@ class ConfigOptionVector : public ConfigOptionVectorBase class ConfigOptionFloat : public ConfigOptionSingle { public: - ConfigOptionFloat() : ConfigOptionSingle(0) {}; - ConfigOptionFloat(double _value) : ConfigOptionSingle(_value) {}; + ConfigOptionFloat() : ConfigOptionSingle(0) {}; + ConfigOptionFloat(double _value) : ConfigOptionSingle(_value) {}; double getFloat() const { return this->value; }; @@ -131,8 +131,8 @@ class ConfigOptionFloats : public ConfigOptionVector class ConfigOptionInt : public ConfigOptionSingle { public: - ConfigOptionInt() : ConfigOptionSingle(0) {}; - ConfigOptionInt(double _value) : ConfigOptionSingle(_value) {}; + ConfigOptionInt() : ConfigOptionSingle(0) {}; + ConfigOptionInt(double _value) : ConfigOptionSingle(_value) {}; int getInt() const { return this->value; }; void setInt(int val) { this->value = val; }; @@ -189,8 +189,8 @@ class ConfigOptionInts : public ConfigOptionVector class ConfigOptionString : public ConfigOptionSingle { public: - ConfigOptionString() : ConfigOptionSingle("") {}; - ConfigOptionString(std::string _value) : ConfigOptionSingle(_value) {}; + ConfigOptionString() : ConfigOptionSingle("") {}; + ConfigOptionString(std::string _value) : ConfigOptionSingle(_value) {}; std::string serialize() const { std::string str = this->value; @@ -314,8 +314,8 @@ class ConfigOptionFloatOrPercent : public ConfigOptionPercent class ConfigOptionPoint : public ConfigOptionSingle { public: - ConfigOptionPoint() : ConfigOptionSingle(Pointf(0,0)) {}; - ConfigOptionPoint(Pointf _value) : ConfigOptionSingle(_value) {}; + ConfigOptionPoint() : ConfigOptionSingle(Pointf(0,0)) {}; + ConfigOptionPoint(Pointf _value) : ConfigOptionSingle(_value) {}; std::string serialize() const { std::ostringstream ss; @@ -383,8 +383,8 @@ class ConfigOptionPoints : public ConfigOptionVector class ConfigOptionBool : public ConfigOptionSingle { public: - ConfigOptionBool() : ConfigOptionSingle(false) {}; - ConfigOptionBool(bool _value) : ConfigOptionSingle(_value) {}; + ConfigOptionBool() : ConfigOptionSingle(false) {}; + ConfigOptionBool(bool _value) : ConfigOptionSingle(_value) {}; bool getBool() const { return this->value; };