|
| 1 | +-- Form B inline descriptor for toml++ (marzer/tomlplusplus) — a TOML config |
| 2 | +-- file parser and serializer for C++17 (and later), exposed as the C++23 |
| 3 | +-- module `tomlplusplus` so users can write `import tomlplusplus;` out of the |
| 4 | +-- box (no opt-in, no `#include` needed). |
| 5 | +-- |
| 6 | +-- Why generated: the released v3.4.0 source tarball is header-only and ships |
| 7 | +-- NO module interface unit. Upstream HAS authored an official one at |
| 8 | +-- `src/modules/tomlplusplus.cppm` (`export module tomlplusplus;`), but it |
| 9 | +-- lives on the `master` branch only and is not in any release tag yet (v3.4.0 |
| 10 | +-- 404s for that path). So we provide it ourselves via mcpp's `generated_files`, |
| 11 | +-- embedding upstream's official tomlplusplus.cppm. The base headers stay |
| 12 | +-- pinned to the reproducible v3.4.0 release tag, straight from upstream — |
| 13 | +-- no fork in the trust path. |
| 14 | +-- |
| 15 | +-- ONE deviation from upstream master's cppm, deliberate and minimal: |
| 16 | +-- `using TOML_NAMESPACE::get_line;` is dropped. `get_line` was added to |
| 17 | +-- `impl/source_region.hpp` AFTER v3.4.0 and does not exist in the pinned |
| 18 | +-- headers, so re-exporting it would not compile. Every other line is verbatim. |
| 19 | +-- |
| 20 | +-- Evolution: once a toml++ release (>3.4.0) ships src/modules/tomlplusplus.cppm, |
| 21 | +-- switch `sources` to "*/src/modules/tomlplusplus.cppm", drop `generated_files`, |
| 22 | +-- and the get_line re-export comes back with it. |
| 23 | +-- |
| 24 | +-- include_dirs exposes the tarball's include/ so the module unit's global-module |
| 25 | +-- fragment `#include <toml++/toml.hpp>` resolves (and `#include` remains |
| 26 | +-- available to users who want it). The upstream path is a GLOB — the leading |
| 27 | +-- `*` absorbs the archive's `tomlplusplus-3.4.0/` wrap layer — while the |
| 28 | +-- generated cppm path is verdir-relative (no glob), like nlohmann.json. |
| 29 | +package = { |
| 30 | + spec = "1", |
| 31 | + namespace = "marzer", |
| 32 | + name = "marzer.tomlplusplus", |
| 33 | + description = "TOML config file parser and serializer for C++, exposed as C++23 module tomlplusplus", |
| 34 | + licenses = {"MIT"}, |
| 35 | + repo = "https://github.com/marzer/tomlplusplus", |
| 36 | + type = "package", |
| 37 | + |
| 38 | + xpm = { |
| 39 | + linux = { |
| 40 | + ["3.4.0"] = { |
| 41 | + url = { |
| 42 | + GLOBAL = "https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz", |
| 43 | + CN = "https://gitcode.com/mcpp-res/tomlplusplus/releases/download/3.4.0/tomlplusplus-3.4.0.tar.gz", |
| 44 | + }, |
| 45 | + sha256 = "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155", |
| 46 | + }, |
| 47 | + }, |
| 48 | + macosx = { |
| 49 | + ["3.4.0"] = { |
| 50 | + url = { |
| 51 | + GLOBAL = "https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz", |
| 52 | + CN = "https://gitcode.com/mcpp-res/tomlplusplus/releases/download/3.4.0/tomlplusplus-3.4.0.tar.gz", |
| 53 | + }, |
| 54 | + sha256 = "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155", |
| 55 | + }, |
| 56 | + }, |
| 57 | + windows = { |
| 58 | + ["3.4.0"] = { |
| 59 | + url = { |
| 60 | + GLOBAL = "https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz", |
| 61 | + CN = "https://gitcode.com/mcpp-res/tomlplusplus/releases/download/3.4.0/tomlplusplus-3.4.0.tar.gz", |
| 62 | + }, |
| 63 | + sha256 = "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155", |
| 64 | + }, |
| 65 | + }, |
| 66 | + }, |
| 67 | + |
| 68 | + mcpp = { |
| 69 | + schema = "0.1", |
| 70 | + language = "c++23", |
| 71 | + import_std = false, |
| 72 | + modules = { "tomlplusplus" }, |
| 73 | + include_dirs = { "*/include" }, |
| 74 | + -- Upstream's official module unit (master @ src/modules/tomlplusplus.cppm), |
| 75 | + -- reproduced verbatim apart from the get_line drop documented above. |
| 76 | + -- Verdir-relative path, no glob. |
| 77 | + generated_files = { |
| 78 | + ["mcpp_generated/tomlplusplus.cppm"] = [==[ |
| 79 | +/** |
| 80 | + * @file tomlpp.cppm |
| 81 | + * @brief File containing the module declaration for toml++. |
| 82 | + */ |
| 83 | +
|
| 84 | +module; |
| 85 | +
|
| 86 | +#define TOML_UNDEF_MACROS 0 |
| 87 | +#include <toml++/toml.hpp> |
| 88 | +
|
| 89 | +export module tomlplusplus; |
| 90 | +
|
| 91 | +/** |
| 92 | + * @namespace toml |
| 93 | + * @brief The toml++ namespace toml:: |
| 94 | + */ |
| 95 | +export namespace toml { |
| 96 | + /** |
| 97 | + * @namespace literals |
| 98 | + * @brief The toml++ namespace toml::literals:: |
| 99 | + */ |
| 100 | + inline namespace literals { |
| 101 | + using TOML_NAMESPACE::literals::operator""_toml; |
| 102 | + using TOML_NAMESPACE::literals::operator""_tpath; |
| 103 | + } |
| 104 | +
|
| 105 | + using TOML_NAMESPACE::array; |
| 106 | + using TOML_NAMESPACE::date; |
| 107 | + using TOML_NAMESPACE::date_time; |
| 108 | + using TOML_NAMESPACE::inserter; |
| 109 | + using TOML_NAMESPACE::json_formatter; |
| 110 | + using TOML_NAMESPACE::key; |
| 111 | + using TOML_NAMESPACE::node; |
| 112 | + using TOML_NAMESPACE::node_view; |
| 113 | + using TOML_NAMESPACE::parse_error; |
| 114 | + using TOML_NAMESPACE::parse_result; |
| 115 | + using TOML_NAMESPACE::path; |
| 116 | + using TOML_NAMESPACE::path_component; |
| 117 | + using TOML_NAMESPACE::source_position; |
| 118 | + using TOML_NAMESPACE::source_region; |
| 119 | + using TOML_NAMESPACE::table; |
| 120 | + using TOML_NAMESPACE::time; |
| 121 | + using TOML_NAMESPACE::time_offset; |
| 122 | + using TOML_NAMESPACE::toml_formatter; |
| 123 | + using TOML_NAMESPACE::value; |
| 124 | + using TOML_NAMESPACE::yaml_formatter; |
| 125 | + using TOML_NAMESPACE::format_flags; |
| 126 | + using TOML_NAMESPACE::node_type; |
| 127 | + using TOML_NAMESPACE::path_component_type; |
| 128 | + using TOML_NAMESPACE::value_flags; |
| 129 | + using TOML_NAMESPACE::array_iterator; |
| 130 | + using TOML_NAMESPACE::const_array_iterator; |
| 131 | + using TOML_NAMESPACE::const_table_iterator; |
| 132 | + using TOML_NAMESPACE::default_formatter; |
| 133 | + using TOML_NAMESPACE::inserted_type_of; |
| 134 | + using TOML_NAMESPACE::optional; |
| 135 | + using TOML_NAMESPACE::source_index; |
| 136 | + using TOML_NAMESPACE::source_path_ptr; |
| 137 | + using TOML_NAMESPACE::table_iterator; |
| 138 | +
|
| 139 | + using TOML_NAMESPACE::at_path; |
| 140 | + using TOML_NAMESPACE::operator""_toml; |
| 141 | + using TOML_NAMESPACE::operator""_tpath; |
| 142 | + using TOML_NAMESPACE::operator<<; |
| 143 | + using TOML_NAMESPACE::parse; |
| 144 | + using TOML_NAMESPACE::parse_file; |
| 145 | +
|
| 146 | + using TOML_NAMESPACE::is_array; |
| 147 | + using TOML_NAMESPACE::is_boolean; |
| 148 | + using TOML_NAMESPACE::is_chronological; |
| 149 | + using TOML_NAMESPACE::is_container; |
| 150 | + using TOML_NAMESPACE::is_date; |
| 151 | + using TOML_NAMESPACE::is_date_time; |
| 152 | + using TOML_NAMESPACE::is_floating_point; |
| 153 | + using TOML_NAMESPACE::is_integer; |
| 154 | + using TOML_NAMESPACE::is_key; |
| 155 | + using TOML_NAMESPACE::is_key_or_convertible; |
| 156 | + using TOML_NAMESPACE::is_node; |
| 157 | + using TOML_NAMESPACE::is_node_view; |
| 158 | + using TOML_NAMESPACE::is_number; |
| 159 | + using TOML_NAMESPACE::is_string; |
| 160 | + using TOML_NAMESPACE::is_table; |
| 161 | + using TOML_NAMESPACE::is_time; |
| 162 | + using TOML_NAMESPACE::is_value; |
| 163 | +
|
| 164 | + using TOML_NAMESPACE::preserve_source_value_flags; |
| 165 | +} |
| 166 | +]==], |
| 167 | + }, |
| 168 | + sources = { "mcpp_generated/tomlplusplus.cppm" }, |
| 169 | + targets = { ["tomlplusplus"] = { kind = "lib" } }, |
| 170 | + deps = { }, |
| 171 | + }, |
| 172 | +} |
0 commit comments