diff options
Diffstat (limited to 'examples/planetary_3d')
| -rw-r--r-- | examples/planetary_3d/.nix/derivation.nix | 39 | ||||
| -rw-r--r-- | examples/planetary_3d/planetary_3d.cpp | 27 |
2 files changed, 66 insertions, 0 deletions
diff --git a/examples/planetary_3d/.nix/derivation.nix b/examples/planetary_3d/.nix/derivation.nix new file mode 100644 index 0000000..c6c3ea6 --- /dev/null +++ b/examples/planetary_3d/.nix/derivation.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, scons +, clang-tools +, forstio +, pname +, version +, kel-lbm +}: + +stdenv.mkDerivation { + pname = pname + "-examples-" + "planetary_3d"; + inherit version; + src = ./..; + + nativeBuildInputs = [ + scons + clang-tools + ]; + + buildInputs = [ + forstio.core + forstio.async + forstio.io + forstio.io_codec + forstio.codec + forstio.codec-unit + forstio.codec-json + forstio.remote + forstio.remote-filesystem + forstio.remote-sycl + forstio.remote-io + kel-lbm + ]; + + preferLocalBuild = true; + + outputs = [ "out" "dev" ]; +} diff --git a/examples/planetary_3d/planetary_3d.cpp b/examples/planetary_3d/planetary_3d.cpp new file mode 100644 index 0000000..e100f48 --- /dev/null +++ b/examples/planetary_3d/planetary_3d.cpp @@ -0,0 +1,27 @@ +#include <forstio/error.hpp> +#include <iostream> + +namespace kel { + +saw::error_or<void> real_main(int argc, char** argv){ + return saw::make_void(); +} +} + +int main(int argc, char** argv){ + auto eov = kel::kel_main(argc, argv); + if(eov.is_error()){ + auto& err = eov.get_error(); + auto err_msg = err.get_message(); + std::cerr<<"[Error]: "<<err.get_category(); + + if(not err_msg.empty()){ + std::cerr<<" - "<<err_msg; + } + std::cerr<<std::endl; + + return err.get_id(); + } + + return 0; +} |
