From f60348f8b7513882b9a51019665614e787efa86e Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Wed, 1 May 2024 16:05:02 +0200 Subject: Bugfix: filename of objects --- xmake.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xmake.cpp') 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); -- cgit v1.2.3