Skip to content

Commit

Permalink
[javascript] Disable stack trace logging when TI_EMSCRIPTENED (JS 9/n) (
Browse files Browse the repository at this point in the history
  • Loading branch information
AmesingFlank authored Jan 29, 2022
1 parent b036161 commit 1e094fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions taichi/system/traceback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <mutex>
#include "spdlog/fmt/bundled/color.h"

#if defined(__APPLE__) || \
(defined(__unix__) && !defined(__linux__)) && !defined(ANDROID)
#if defined(__APPLE__) || (defined(__unix__) && !defined(__linux__)) && \
!defined(ANDROID) && !defined(TI_EMSCRIPTENED)
#include <execinfo.h>
#include <cxxabi.h>
#endif
Expand Down Expand Up @@ -308,6 +308,12 @@ void print_traceback() {
fmt::print(fg(fmt::color::magenta), "* Taichi Compiler Stack Traceback *\n");
fmt::print(fg(fmt::color::magenta), "***********************************\n");
fmt::print(fg(fmt::color::magenta), "NOT SUPPORTED ON ANDROID\n");
#elif defined(TI_EMSCRIPTENED)
// Not supported
fmt::print(fg(fmt::color::magenta), "***********************************\n");
fmt::print(fg(fmt::color::magenta),
"* Emscriptened Taichi Compiler Stack Traceback *\n");
fmt::print(fg(fmt::color::magenta), "***********************************\n");
#else
// Based on http://man7.org/linux/man-pages/man3/backtrace.3.html
constexpr int BT_BUF_SIZE = 1024;
Expand Down

0 comments on commit 1e094fe

Please sign in to comment.