From 6bd92a819805946e97b614df4f1e9e4d7a9142e9 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 19 Sep 2018 11:27:04 +0200 Subject: [PATCH] Disabling calls from libslic3r to slic3r gui. --- CMakeLists.txt | 5 +++++ src/libslic3r/Format/3mf.cpp | 3 ++- src/libslic3r/Format/AMF.cpp | 3 ++- src/slic3r/GUI/GLToolbar.hpp | 2 +- src/slic3r/GUI/GUI.hpp | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e1817f54..80aa7ff08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,11 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals" ) endif() +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type" ) +endif() + # Where all the bundled libraries reside? set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) # For the bundled boost libraries (boost::nowide) diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 43c99f19f..c9b4989f5 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -667,7 +667,8 @@ namespace Slic3r { add_error("Error while reading config data to buffer"); return; } - bundle.load_config_string(buffer.data(), archive_filename.c_str()); +//FIXME Get rid of the dependencies on slic3r GUI library! +// bundle.load_config_string(buffer.data(), archive_filename.c_str()); } } diff --git a/src/libslic3r/Format/AMF.cpp b/src/libslic3r/Format/AMF.cpp index 458ce79de..89a0eacbe 100644 --- a/src/libslic3r/Format/AMF.cpp +++ b/src/libslic3r/Format/AMF.cpp @@ -467,7 +467,8 @@ void AMFParserContext::endElement(const char * /* name */) case NODE_TYPE_METADATA: if ((m_preset_bundle != nullptr) && strncmp(m_value[0].c_str(), SLIC3R_CONFIG_TYPE, strlen(SLIC3R_CONFIG_TYPE)) == 0) { - m_preset_bundle->load_config_string(m_value[1].c_str(), m_archive_filename.c_str()); +//FIXME Get rid of the dependencies on slic3r GUI library! +// m_preset_bundle->load_config_string(m_value[1].c_str(), m_archive_filename.c_str()); } else if (strncmp(m_value[0].c_str(), "slic3r.", 7) == 0) { const char *opt_key = m_value[0].c_str() + 7; diff --git a/src/slic3r/GUI/GLToolbar.hpp b/src/slic3r/GUI/GLToolbar.hpp index 65d6748ff..c67e78f58 100644 --- a/src/slic3r/GUI/GLToolbar.hpp +++ b/src/slic3r/GUI/GLToolbar.hpp @@ -2,7 +2,7 @@ #define slic3r_GLToolbar_hpp_ #include "../../slic3r/GUI/GLTexture.hpp" -#include "../../callback.hpp" +#include "callback.hpp" #include #include diff --git a/src/slic3r/GUI/GUI.hpp b/src/slic3r/GUI/GUI.hpp index 8dfaf42c6..9539cd7cc 100644 --- a/src/slic3r/GUI/GUI.hpp +++ b/src/slic3r/GUI/GUI.hpp @@ -4,7 +4,7 @@ #include #include #include "PrintConfig.hpp" -#include "../../callback.hpp" +#include "callback.hpp" #include "GUI_ObjectParts.hpp" #include