diff options
author | Roland Reichwein <mail@reichwein.it> | 2024-05-01 16:05:02 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2024-05-01 16:05:02 +0200 |
commit | f60348f8b7513882b9a51019665614e787efa86e (patch) | |
tree | 9d92f8eb98b0d77198119ab12ddf4c12c09d64fc | |
parent | 8c344cf8fabded65cee42c69f63d2e47b9bef8d3 (diff) |
Bugfix: filename of objects
-rw-r--r-- | xmake.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |