mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 22:05:56 +08:00
Cpp11 (#3731)
* Enabled c++11 support (required for IO::AMF), extended Travis build to build with g++ 4.9 * ifdef guard in poly2tri/util to avoid redefinition warning * cache local-lib
This commit is contained in:
parent
46ea9c5066
commit
3c4f93cf24
@ -11,13 +11,18 @@ branches:
|
||||
- stable
|
||||
sudo: false
|
||||
cache:
|
||||
- apt
|
||||
apt: true
|
||||
directories:
|
||||
- local-lib
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- boost-latest
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libboost-thread1.55-dev
|
||||
- libboost-system1.55-dev
|
||||
- libboost-filesystem1.55-dev
|
||||
- liblocal-lib-perl
|
||||
- g++-4.9
|
||||
env: CC=g++-4.9
|
||||
|
@ -15,8 +15,13 @@ my $mswin = $^O eq 'MSWin32';
|
||||
# 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
|
||||
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
||||
# std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0
|
||||
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE
|
||||
-Wno-c++11-extensions);
|
||||
-std=c++11);
|
||||
if ($cpp_guess->is_gcc) {
|
||||
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
|
||||
push @cflags, qw(-U__STRICT_ANSI__);
|
||||
}
|
||||
my @ldflags = ();
|
||||
if ($^O eq 'darwin') {
|
||||
push @ldflags, qw(-framework IOKit -framework CoreFoundation);
|
||||
|
@ -33,7 +33,9 @@
|
||||
#define UTILS_H
|
||||
|
||||
// Otherwise #defines like M_PI are undeclared under Visual Studio
|
||||
#ifndef _USE_MATH_DEFINES
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <math.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user