From 1e094fe1106ef7288c60d268a76f0f42bf7ce604 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Sat, 29 Jan 2022 09:15:46 +0000 Subject: [PATCH] [javascript] Disable stack trace logging when TI_EMSCRIPTENED (JS 9/n) (#4117) --- taichi/system/traceback.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/taichi/system/traceback.cpp b/taichi/system/traceback.cpp index b9368eec2c4f1..a9a2222e93499 100644 --- a/taichi/system/traceback.cpp +++ b/taichi/system/traceback.cpp @@ -15,8 +15,8 @@ #include #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 #include #endif @@ -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;