Skip to content

Commit

Permalink
Allow for compiling with debug output turned on by default.
Browse files Browse the repository at this point in the history
Automatically log at the DEBUG level if this is done.
Fix compile issue where Log.hpp wasn't available.
  • Loading branch information
lordofhyphens committed Mar 15, 2021
1 parent d73ab66 commit 5d371aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ option(SLIC3R_STATIC "Build and link Slic3r statically." ON)
option(BUILD_EXTRUDE_TIN "Build and link the extrude-tin application." OFF)
option(PROFILE "Build with gprof profiling output." OFF)
option(COVERAGE "Build with gcov code coverage profiling." OFF)
option(SLIC3R_DEBUG "Build with Slic3r's debug output" OFF)

# only on newer GCCs: -ftemplate-backtrace-limit=0
add_compile_options(-ftemplate-backtrace-limit=0)
add_compile_options(-DNO_PERL -DM_PI=3.14159265358979323846 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE)
if(SLIC3R_DEBUG)
add_compile_options(-DSLIC3R_DEBUG)
endif()

if (MSVC)
add_compile_options(-W3)
Expand Down
3 changes: 3 additions & 0 deletions src/slic3r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ main(int argc, char **argv) {
#endif // BUILD_TEST

int CLI::run(int argc, char **argv) {
#ifdef SLIC3R_DEBUG
slic3r_log->set_level(log_t::DEBUG);
#endif
// Convert arguments to UTF-8 (needed on Windows).
// argv then points to memory owned by a.
boost::nowide::args a(argc, argv);
Expand Down
1 change: 1 addition & 0 deletions xs/src/libslic3r/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "ClipperUtils.hpp"
#include "Geometry.hpp"
#include "Print.hpp"
#include "Log.hpp"

namespace Slic3r {

Expand Down

0 comments on commit 5d371aa

Please sign in to comment.