From 29eeb5342b31ee6abf5e491fae35296b8ed36cba Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Wed, 13 Nov 2024 23:43:19 +0800 Subject: [PATCH] [7_15] Add require cpptrace 0.7.1 --- src/System/Boot/init_texmacs.cpp | 8 +++++++- xmake.lua | 3 +++ xmake/packages.lua | 4 ++++ xmake/research.lua | 1 + xmake/tests.lua | 1 + xmake/vars.lua | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/System/Boot/init_texmacs.cpp b/src/System/Boot/init_texmacs.cpp index 1e42213ad3..10611bd6e9 100644 --- a/src/System/Boot/init_texmacs.cpp +++ b/src/System/Boot/init_texmacs.cpp @@ -39,6 +39,10 @@ #endif #include "Metafont/load_tex.hpp" +#ifndef OS_WASM +#include +#endif + #include #include @@ -70,7 +74,9 @@ void server_start (); void clean_exit_on_segfault (int sig_num) { (void) sig_num; - cerr << lolly::get_stacktrace () << LF; +#ifndef OS_WASM + cpptrace::generate_trace ().print (); +#endif TM_FAILED ("segmentation fault"); } diff --git a/xmake.lua b/xmake.lua index ecab439a7f..ccb18bc592 100644 --- a/xmake.lua +++ b/xmake.lua @@ -202,6 +202,9 @@ target("libmogan") do build_glue_on_config() add_tm_configure("libmogan", TM_CONFIGURE_VARS) + if not is_plat("wasm") then + add_packages("cpptrace") + end add_packages("moebius") if not is_plat("macosx") then add_packages("libiconv") diff --git a/xmake/packages.lua b/xmake/packages.lua index 0c3b220da0..ab41902312 100644 --- a/xmake/packages.lua +++ b/xmake/packages.lua @@ -29,6 +29,10 @@ function using_pacman () end function add_requires_of_mogan() + if not is_plat("wasm") then + add_requires("cpptrace", {version = CPPTRACE_VERSION, system=false}) + end + tbox_configs = {hash=true, ["force-utf8"]=true, charset=true} add_requires("tbox " .. TBOX_VERSION, {system=false, configs=tbox_configs}) diff --git a/xmake/research.lua b/xmake/research.lua index 051c27d93d..5d921ceda3 100644 --- a/xmake/research.lua +++ b/xmake/research.lua @@ -145,6 +145,7 @@ function add_target_research_on_others() add_frameworks("QtGui", "QtWidgets", "QtCore", "QtPrintSupport", "QtSvg") + add_packages("cpptrace") add_packages("moebius") if is_plat("mingw", "windows") then add_packages("qt6widgets") diff --git a/xmake/tests.lua b/xmake/tests.lua index f6c941014e..aa8fab889f 100644 --- a/xmake/tests.lua +++ b/xmake/tests.lua @@ -27,6 +27,7 @@ function add_target_cpp_test(filepath, dep) if is_plat ("mingw") then add_packages("mingw-w64") end + add_packages("cpptrace") add_packages("s7") add_packages("tree-sitter") add_packages("tree-sitter-cpp") diff --git a/xmake/vars.lua b/xmake/vars.lua index cc0109a9d8..5937c46c1c 100644 --- a/xmake/vars.lua +++ b/xmake/vars.lua @@ -23,6 +23,7 @@ TBOX_VERSION = "1.7.6" LOLLY_VERSION = "1.4.26" -- Third-party dependencies +CPPTRACE_VERSION = "v0.7.1" S7_VERSION = "20240816" TREESITTER_VERSION = "0.22.6" TREESITTER_CPP_VERSION = "0.22.2"