summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-05-01 16:05:02 +0200
committerRoland Reichwein <mail@reichwein.it>2024-05-01 16:05:02 +0200
commitf60348f8b7513882b9a51019665614e787efa86e (patch)
tree9d92f8eb98b0d77198119ab12ddf4c12c09d64fc
parent8c344cf8fabded65cee42c69f63d2e47b9bef8d3 (diff)
Bugfix: filename of objects
-rw-r--r--xmake.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake.cpp b/xmake.cpp
index c1095f4..6c6b443 100644
--- a/xmake.cpp
+++ b/xmake.cpp
@@ -78,13 +78,18 @@ int xmake(int argc, char* argv[])
// compile
for (auto &i: sources) {
fs::path p{i};
- commands.push_back(fmt::format("g++ -std=c++17 -c {} -o {}", p.string(), p.replace_extension("o").string()));
+ fs::path p_obj{i};
+ p_obj.replace_extension("o");
+ commands.push_back(fmt::format("g++ -std=c++17 -c {} -o {}", p.string(), p_obj.string()));
}
// link
std::string link_command{"g++"};
for (auto &i: sources) {
- link_command += fmt::format(" {}", fs::path{i}.replace_extension("o").string());
+ fs::path p_obj{i};
+ p_obj.replace_extension("o");
+ link_command += fmt::format(" {}", p_obj.string());
}
+ link_command += " -lfmt";
link_command += fmt::format(" -o {}", target);
commands.push_back(link_command);