diff options
-rw-r--r-- | cgal.pri | 4 | ||||
-rw-r--r-- | openscad.pro | 8 | ||||
-rwxr-xr-x | scripts/linux-build-dependencies.sh | 12 | ||||
-rw-r--r-- | scripts/setenv-linbuild-clang.sh | 8 |
4 files changed, 29 insertions, 3 deletions
@@ -25,4 +25,8 @@ cgal { QMAKE_CXXFLAGS += -frounding-math } } + + *clang* { + QMAKE_CXXFLAGS -= -frounding-math + } } diff --git a/openscad.pro b/openscad.pro index 68aa1cc..25e7608 100644 --- a/openscad.pro +++ b/openscad.pro @@ -103,6 +103,14 @@ netbsd* { QMAKE_CXXFLAGS *= -fno-strict-aliasing } +*clang* { + # disable enormous amount of warnings about CGAL + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function + QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions +} + CONFIG(skip-version-check) { # force the use of outdated libraries DEFINES += OPENSCAD_SKIP_VERSION_CHECK diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 36dc2ee..d7d8f49 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -118,8 +118,14 @@ build_boost() cd boost_$bversion # We only need certain portions of boost ./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,filesystem,system,regex - ./bjam -j$NUMCPU - ./bjam install + if [ $CXX ]; then + if [ $CXX = "clang" ]; then + ./b2 -j$NUMCPU toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" install + fi + else + ./b2 -j$NUMCPU + ./b2 install + fi } build_cgal() @@ -137,7 +143,7 @@ build_cgal() fi tar xzf CGAL-$version.tar.gz cd CGAL-$version - if [ $2 = use-sys-libs ]; then + if [ $2 = use-sys-libs ]; then cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DCMAKE_BUILD_TYPE=Debug else cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=Debug diff --git a/scripts/setenv-linbuild-clang.sh b/scripts/setenv-linbuild-clang.sh new file mode 100644 index 0000000..c4e02f8 --- /dev/null +++ b/scripts/setenv-linbuild-clang.sh @@ -0,0 +1,8 @@ +# build dependencies and openscad on linux with clang. + +export CC=clang +export CXX=clang++ +export QMAKESPEC=unsupported/linux-clang + +. ./scripts/setenv-linbuild.sh + |