mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 14:13:57 -06:00
Fix compilation with GCC
This commit is contained in:
parent
44825d91af
commit
b8f0391934
2 changed files with 15 additions and 16 deletions
11
xs/Build.PL
11
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
|
# In order to generate the -l switches we need to know how Boost libraries are named
|
||||||
my $have_boost = 0;
|
my $have_boost = 0;
|
||||||
|
my @boost_libraries = qw(system thread); # we need these
|
||||||
|
|
||||||
# check without explicit lib path (works on Linux)
|
# check without explicit lib path (works on Linux)
|
||||||
$have_boost = 1
|
$have_boost = 1
|
||||||
if check_lib(
|
if check_lib(
|
||||||
lib => "boost_system",
|
lib => [ map "boost_${_}", @boost_libraries ],
|
||||||
INC => join(' ', map "-I$_", @INC, @boost_include),
|
|
||||||
LIBS => join(' ', map "-L$_", @INC, @boost_libs),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($have_boost) {
|
if ($have_boost) {
|
||||||
push @LIBS, '-lboost_system', '-lboost_thread';
|
push @LIBS, map "-l$_", @boost_libraries;
|
||||||
} else {
|
} else {
|
||||||
foreach my $path (@boost_libs) {
|
foreach my $path (@boost_libs) {
|
||||||
my @files = glob "$path/libboost_system*";
|
my @files = glob "$path/libboost_system*";
|
||||||
|
@ -66,13 +65,13 @@ if ($have_boost) {
|
||||||
if ($files[0] =~ /libboost_system([^.]+)/) {
|
if ($files[0] =~ /libboost_system([^.]+)/) {
|
||||||
my $suffix = $1;
|
my $suffix = $1;
|
||||||
check_lib(
|
check_lib(
|
||||||
lib => "boost_system$suffix",
|
lib => [ map "boost_${_}${suffix}", @boost_libraries ],
|
||||||
INC => join(' ', map "-I$_", @INC, @boost_include),
|
INC => join(' ', map "-I$_", @INC, @boost_include),
|
||||||
LIBS => "-L$path",
|
LIBS => "-L$path",
|
||||||
) or next;
|
) or next;
|
||||||
|
|
||||||
push @INC, (map " -I$_", @boost_include); # TODO: only use the one related to the chosen lib path
|
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;
|
$have_boost = 1;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,8 @@ class ConfigOptionVector : public ConfigOptionVectorBase
|
||||||
class ConfigOptionFloat : public ConfigOptionSingle<double>
|
class ConfigOptionFloat : public ConfigOptionSingle<double>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigOptionFloat() : ConfigOptionSingle(0) {};
|
ConfigOptionFloat() : ConfigOptionSingle<double>(0) {};
|
||||||
ConfigOptionFloat(double _value) : ConfigOptionSingle(_value) {};
|
ConfigOptionFloat(double _value) : ConfigOptionSingle<double>(_value) {};
|
||||||
|
|
||||||
double getFloat() const { return this->value; };
|
double getFloat() const { return this->value; };
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ class ConfigOptionFloats : public ConfigOptionVector<double>
|
||||||
class ConfigOptionInt : public ConfigOptionSingle<int>
|
class ConfigOptionInt : public ConfigOptionSingle<int>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigOptionInt() : ConfigOptionSingle(0) {};
|
ConfigOptionInt() : ConfigOptionSingle<int>(0) {};
|
||||||
ConfigOptionInt(double _value) : ConfigOptionSingle(_value) {};
|
ConfigOptionInt(double _value) : ConfigOptionSingle<int>(_value) {};
|
||||||
|
|
||||||
int getInt() const { return this->value; };
|
int getInt() const { return this->value; };
|
||||||
void setInt(int val) { this->value = val; };
|
void setInt(int val) { this->value = val; };
|
||||||
|
@ -189,8 +189,8 @@ class ConfigOptionInts : public ConfigOptionVector<int>
|
||||||
class ConfigOptionString : public ConfigOptionSingle<std::string>
|
class ConfigOptionString : public ConfigOptionSingle<std::string>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigOptionString() : ConfigOptionSingle("") {};
|
ConfigOptionString() : ConfigOptionSingle<std::string>("") {};
|
||||||
ConfigOptionString(std::string _value) : ConfigOptionSingle(_value) {};
|
ConfigOptionString(std::string _value) : ConfigOptionSingle<std::string>(_value) {};
|
||||||
|
|
||||||
std::string serialize() const {
|
std::string serialize() const {
|
||||||
std::string str = this->value;
|
std::string str = this->value;
|
||||||
|
@ -314,8 +314,8 @@ class ConfigOptionFloatOrPercent : public ConfigOptionPercent
|
||||||
class ConfigOptionPoint : public ConfigOptionSingle<Pointf>
|
class ConfigOptionPoint : public ConfigOptionSingle<Pointf>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigOptionPoint() : ConfigOptionSingle(Pointf(0,0)) {};
|
ConfigOptionPoint() : ConfigOptionSingle<Pointf>(Pointf(0,0)) {};
|
||||||
ConfigOptionPoint(Pointf _value) : ConfigOptionSingle(_value) {};
|
ConfigOptionPoint(Pointf _value) : ConfigOptionSingle<Pointf>(_value) {};
|
||||||
|
|
||||||
std::string serialize() const {
|
std::string serialize() const {
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
|
@ -383,8 +383,8 @@ class ConfigOptionPoints : public ConfigOptionVector<Pointf>
|
||||||
class ConfigOptionBool : public ConfigOptionSingle<bool>
|
class ConfigOptionBool : public ConfigOptionSingle<bool>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigOptionBool() : ConfigOptionSingle(false) {};
|
ConfigOptionBool() : ConfigOptionSingle<bool>(false) {};
|
||||||
ConfigOptionBool(bool _value) : ConfigOptionSingle(_value) {};
|
ConfigOptionBool(bool _value) : ConfigOptionSingle<bool>(_value) {};
|
||||||
|
|
||||||
bool getBool() const { return this->value; };
|
bool getBool() const { return this->value; };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue