diff --git a/libgm/CMakeLists.txt b/libgm/CMakeLists.txt index ccde502..0625e76 100644 --- a/libgm/CMakeLists.txt +++ b/libgm/CMakeLists.txt @@ -34,19 +34,8 @@ else() set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() endif() -if (WASI) - add_definitions( - -DBOOST_EXCEPTION_DISABLE - -DBOOST_NO_EXCEPTIONS - -DBOOST_SP_NO_ATOMIC_ACCESS - -DBOOST_AC_DISABLE_THREADS - -DBOOST_NO_CXX11_HDR_MUTEX - -DBOOST_NO_CXX11_HDR_ATOMIC - ) -endif() -set(boost_libs program_options) -find_package(Boost REQUIRED COMPONENTS ${boost_libs}) +find_package(Boost REQUIRED COMPONENTS program_options) find_package(Git) @@ -135,4 +124,4 @@ add_custom_target( -style=file -i ${CLANGFORMAT_FILES} -) \ No newline at end of file +) diff --git a/libgm/tools/gmpack.cpp b/libgm/tools/gmpack.cpp index c237777..8ef9222 100644 --- a/libgm/tools/gmpack.cpp +++ b/libgm/tools/gmpack.cpp @@ -24,7 +24,6 @@ #include #include #include -#include "wasmexcept.hpp" #include "Bitstream.hpp" #include "Chip.hpp" #include "ChipConfig.hpp" diff --git a/libgm/tools/gmunpack.cpp b/libgm/tools/gmunpack.cpp index b2f0349..d5549d6 100644 --- a/libgm/tools/gmunpack.cpp +++ b/libgm/tools/gmunpack.cpp @@ -23,7 +23,6 @@ #include #include #include -#include "wasmexcept.hpp" #include "Bitstream.hpp" #include "Chip.hpp" #include "ChipConfig.hpp" diff --git a/libgm/tools/wasmexcept.hpp b/libgm/tools/wasmexcept.hpp deleted file mode 100644 index 2da4693..0000000 --- a/libgm/tools/wasmexcept.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#if defined(__wasm) - -#include -#include - -extern "C" { -// FIXME: WASI does not currently support exceptions. -void *__cxa_allocate_exception(size_t thrown_size) throw() { return malloc(thrown_size); } -bool __cxa_uncaught_exception() throw(); -void __cxa_throw(void *thrown_exception, struct std::type_info *tinfo, void (*dest)(void *)) { (void)thrown_exception; (void)tinfo; (void)dest; std::terminate(); } -} - -namespace boost { -struct source_location; -void throw_exception(std::exception const &e) { - std::cerr << "boost::exception(): " << e.what() << std::endl; - exit(1); -} -void throw_exception(std::exception const &e, boost::source_location const &) { - std::cerr << "boost::exception(): " << e.what() << std::endl; - exit(1); -} -} // namespace boost - -#endif