From 619def44c1cca9f3cdf63544d5f24f2c7a7d9b77 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 22 Feb 2022 17:03:21 +0100 Subject: Initial self-hosting commit This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche Co-authored-by: Victor Moreno --- .../build_engine/base_maps/module_name.hpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/buildtool/build_engine/base_maps/module_name.hpp (limited to 'src/buildtool/build_engine/base_maps/module_name.hpp') diff --git a/src/buildtool/build_engine/base_maps/module_name.hpp b/src/buildtool/build_engine/base_maps/module_name.hpp new file mode 100644 index 00000000..26465bf6 --- /dev/null +++ b/src/buildtool/build_engine/base_maps/module_name.hpp @@ -0,0 +1,36 @@ +#ifndef INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_MODULE_NAME_HPP +#define INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_MODULE_NAME_HPP + +#include "src/utils/cpp/hash_combine.hpp" + +namespace BuildMaps::Base { + +struct ModuleName { + std::string repository{}; + std::string module{}; + + ModuleName(std::string repository, std::string module) + : repository{std::move(repository)}, module{std::move(module)} {} + + [[nodiscard]] auto operator==(ModuleName const& other) const noexcept + -> bool { + return module == other.module && repository == other.repository; + } +}; +} // namespace BuildMaps::Base + +namespace std { +template <> +struct hash { + [[nodiscard]] auto operator()( + const BuildMaps::Base::ModuleName& t) const noexcept -> std::size_t { + size_t seed{}; + hash_combine(&seed, t.repository); + hash_combine(&seed, t.module); + return seed; + } +}; + +} // namespace std + +#endif -- cgit v1.2.3