diff --git a/doc/introduction.adoc b/doc/introduction.adoc index 69b08ef..3c27d3a 100644 --- a/doc/introduction.adoc +++ b/doc/introduction.adoc @@ -55,3 +55,10 @@ prints, natively, on wasm32-wasip2, on wasm32-wasip3 and with Emscripten: ---- include::{examples}/config_quick_start.expected[] ---- + +Built with `exception-handling=off`, the same program prints: + +[listing] +---- +include::{examples}/config_quick_start_no_exceptions.expected[] +---- diff --git a/example/Jamfile b/example/Jamfile index c66d00e..94d1257 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -10,4 +10,8 @@ import webcpp ; webcpp.targets native wasip2 wasip3 emscripten ; -webcpp.example config_quick_start.cpp ; +# Each exception mode keeps the quick start's actual output. Select the +# matching example without changing the exception mode the build requested. +webcpp.example config_quick_start.cpp : off:no ; +webcpp.example config_quick_start_no_exceptions.cpp + : on:no ; diff --git a/example/config_quick_start_no_exceptions.cpp b/example/config_quick_start_no_exceptions.cpp new file mode 100644 index 0000000..2bd0533 --- /dev/null +++ b/example/config_quick_start_no_exceptions.cpp @@ -0,0 +1,9 @@ +// Copyright (c) 2026 WebCpp.org +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// The same quick start, built without exceptions and checked against its own recorded output. +// NOLINTNEXTLINE(bugprone-suspicious-include) +#include "config_quick_start.cpp" diff --git a/example/config_quick_start_no_exceptions.expected b/example/config_quick_start_no_exceptions.expected new file mode 100644 index 0000000..63171d3 --- /dev/null +++ b/example/config_quick_start_no_exceptions.expected @@ -0,0 +1 @@ +my_library: exceptions off