| 126 | } |
| 127 | |
| 128 | static std::vector<std::string> expand_cmake_paths(const std::vector<std::string> &sources, const fs::path &toml_dir, bool is_root_project) { |
| 129 | std::vector<std::string> paths; |
| 130 | for (const auto &src : sources) { |
| 131 | auto expanded = expand_cmake_path(src, toml_dir, is_root_project); |
| 132 | for (const auto &f : expanded) { |
| 133 | paths.push_back(f.string()); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // Normalize all paths to work with CMake (it needs a / on Windows as well) |
| 138 | for (auto &path : paths) { |
| 139 | std::replace(path.begin(), path.end(), '\\', '/'); |
| 140 | } |
| 141 | |
| 142 | // Sort paths alphabetically for consistent cross-OS generation |
| 143 | std::sort(paths.begin(), paths.end()); |
| 144 | |
| 145 | // TODO: remove duplicates |
| 146 | |
| 147 | return paths; |
| 148 | } |
| 149 | |
| 150 | static void create_file(const fs::path &path, const std::string &contents) { |
| 151 | if (!path.parent_path().empty()) { |
no test coverage detected