summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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);