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;