|
3 | 3 | #include "error.h" |
4 | 4 | #include "literals.h" |
5 | 5 |
|
6 | | -#include <filesystem> |
| 6 | +#include "fs.hpp" |
7 | 7 | #include <fstream> |
8 | 8 | #include <new> |
9 | 9 | #include <sstream> |
|
12 | 12 | #include <string.h> |
13 | 13 | #include <string> |
14 | 14 |
|
15 | | -namespace fs = std::filesystem; |
16 | | - |
17 | 15 | namespace cmkr::gen { |
18 | 16 |
|
19 | 17 | namespace detail { |
@@ -221,9 +219,9 @@ int generate_cmake(const char *path) { |
221 | 219 | for (const auto &set : cmake.settings) { |
222 | 220 | std::string set_val; |
223 | 221 | if (set.val.index() == 1) { |
224 | | - set_val = std::get<std::string>(set.val); |
| 222 | + set_val = set.val.second; |
225 | 223 | } else { |
226 | | - set_val = std::get<bool>(set.val) ? "ON" : "OFF"; |
| 224 | + set_val = set.val.first ? "ON" : "OFF"; |
227 | 225 | } |
228 | 226 | ss << "set(" << set.name << " " << set_val; |
229 | 227 | ; |
@@ -256,8 +254,8 @@ int generate_cmake(const char *path) { |
256 | 254 | bin_type = ""; |
257 | 255 | add_command = "add_library"; |
258 | 256 | } else { |
259 | | - throw std::runtime_error( |
260 | | - "[cmkr] error: Unknown binary type! Supported types are exe, lib, shared, static, interface"); |
| 257 | + throw std::runtime_error("[cmkr] error: Unknown binary type! Supported types " |
| 258 | + "are exe, lib, shared, static, interface"); |
261 | 259 | } |
262 | 260 |
|
263 | 261 | if (!bin.sources.empty()) { |
@@ -370,10 +368,10 @@ int generate_cmake(const char *path) { |
370 | 368 | } |
371 | 369 | } |
372 | 370 | ss << "\n\tDESTINATION " << inst.destination << "\n\t"; |
373 | | - if (!inst.targets.empty()) |
| 371 | + if (!inst.targets.empty()) |
374 | 372 | ss << "COMPONENT " << inst.targets[0] << "\n\t)\n\n"; |
375 | 373 | else |
376 | | - ss << "\n\t)\n\n"; |
| 374 | + ss << "\n\t)\n\n"; |
377 | 375 | } |
378 | 376 | } |
379 | 377 |
|
|
0 commit comments