From ab161d5a2b82cbe7f3b2a26a68ba0e417d703571 Mon Sep 17 00:00:00 2001 From: Seth LaForge Date: Sun, 28 Jan 2024 23:14:54 -0800 Subject: [PATCH] Fix DEBUG build (#3861) * Fix asserts which would not compile. * Fix DEBUG build. Fully enable checking gcode placeholders in debug builds. --- src/libslic3r/GCode.cpp | 2 +- src/libslic3r/GCode.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 05203f1cdf..63644cb6de 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2956,7 +2956,7 @@ std::string GCode::placeholder_parser_process(const std::string &name, const std // Orca: Added CMake config option since debug is rarely used in current workflow. // Also changed from throwing error immediately to storing messages till slicing is completed // to raise all errors at the same time. -#if !defined(NDEBUG) || ORCA_CHECK_GCODE_PLACEHOLDERS // CHECK_CUSTOM_GCODE_PLACEHOLDERS +#if ORCA_CHECK_GCODE_PLACEHOLDERS if (config_override) { const auto& custom_gcode_placeholders = custom_gcode_specific_placeholders(); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 2260920dc7..09aed39d2d 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -523,6 +523,11 @@ private: double m_last_mm3_per_mm; #endif // ENABLE_GCODE_VIEWER_DATA_CHECKING + // Always check gcode placeholders when building in debug mode. +#if !defined(NDEBUG) +#define ORCA_CHECK_GCODE_PLACEHOLDERS 1 +#endif + #if ORCA_CHECK_GCODE_PLACEHOLDERS std::map> m_placeholder_error_messages; #endif