Skip to content

Commit

Permalink
Added meson config for testing embedded builds
Browse files Browse the repository at this point in the history
  • Loading branch information
zajo committed Aug 4, 2024
1 parent 1f74580 commit 05b94df
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@
{
"label": "Configure Meson build directories",
"type": "shell",
"command": "cd ${workspaceRoot} && meson -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/debug && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/release --buildtype release && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release && meson -D leaf_diagnostics=0 -D cpp_eh=none -D b_ndebug=true -D b_lto=true -D leaf_enable_benchmarks=true _bld/benchmark --buildtype release",
"command": "cd ${workspaceRoot} && meson setup -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/debug && meson setup -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson setup -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/release --buildtype release && meson setup -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release && meson setup -D leaf_diagnostics=0 -D cpp_eh=none -D b_ndebug=true -D b_lto=true -D leaf_enable_benchmarks=true _bld/benchmark --buildtype release",
"problemMatcher": []
},
{
"label": "Configure Meson build directories (no Boost)",
"type": "shell",
"command": "cd ${workspaceRoot} && meson -D leaf_lua_examples=true _bld/debug && meson -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson -D leaf_lua_examples=true _bld/release --buildtype release && meson -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release",
"command": "cd ${workspaceRoot} && meson setup -D leaf_lua_examples=true _bld/debug && meson setup -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson setup -D leaf_lua_examples=true _bld/release --buildtype release && meson setup -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release",
"problemMatcher": []
},
{
"label": "Configure Meson build directories (test embedded)",
"type": "shell",
"command": "cd ${workspaceRoot} && meson setup -D leaf_embedded=true -D leaf_diagnostics=0 _bld/debug && meson setup -D leaf_embedded=true -D leaf_diagnostics=0 -D leaf_hpp=true _bld/debug_leaf_hpp && meson setup -D leaf_embedded=true -D leaf_diagnostics=0 _bld/release --buildtype release && meson setup -D leaf_embedded=true -D leaf_diagnostics=0 -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release",
"problemMatcher": []
},
{
"label": "Configure Meson build directories (test embedded, no exceptions)",
"type": "shell",
"command": "cd ${workspaceRoot} && meson setup -D cpp_eh=none -D leaf_embedded=true -D leaf_diagnostics=0 _bld/debug && meson setup -D cpp_eh=none -D leaf_embedded=true -D leaf_diagnostics=0 -D leaf_hpp=true _bld/debug_leaf_hpp && meson setup -D cpp_eh=none -D leaf_embedded=true -D leaf_diagnostics=0 _bld/release --buildtype release && meson setup -D cpp_eh=none -D leaf_embedded=true -D leaf_diagnostics=0 -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release",
"problemMatcher": []
},
{
Expand Down
16 changes: 16 additions & 0 deletions example/try_capture_all_eh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
// objects between threads, using exception handling. See capture_in_result.cpp
// for the version that does not use exception handling.

#include <boost/leaf/config.hpp>

#if !BOOST_LEAF_CFG_CAPTURE || defined(BOOST_LEAF_NO_EXCEPTIONS)

#include <iostream>

int main()
{
std::cout << "Unit test not applicable." << std::endl;
return 0;
}

#else

#include <boost/leaf.hpp>
#include <vector>
#include <string>
Expand Down Expand Up @@ -88,3 +102,5 @@ int main()
} );
}
}

#endif
16 changes: 16 additions & 0 deletions example/try_capture_all_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
// objects between threads, without using exception handling. See capture_eh.cpp
// for the version that uses exception handling.

#include <boost/leaf/config.hpp>

#if !BOOST_LEAF_CFG_CAPTURE

#include <iostream>

int main()
{
std::cout << "Unit test not applicable." << std::endl;
return 0;
}

#else

#include <boost/leaf.hpp>
#include <vector>
#include <string>
Expand Down Expand Up @@ -110,3 +124,5 @@ namespace boost
}

#endif

#endif

0 comments on commit 05b94df

Please sign in to comment.