diff options
Diffstat (limited to 'xmake.cpp')
-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); |