From cd36f59cac72920d1b46036da3ddcc82f7280c96 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 27 Aug 2021 20:44:10 +0200 Subject: Fix path to string conversions. --- task_cc.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'task_cc.cc') diff --git a/task_cc.cc b/task_cc.cc index 366cbfe..af9cf7a 100644 --- a/task_cc.cc +++ b/task_cc.cc @@ -164,7 +164,7 @@ bool TaskCC::dirtyInner() } { - auto lastFlags = readFile(flagsFile); + auto lastFlags = readFile(flagsFile.string()); if(flagsString() != lastFlags) { //std::cout << "The compiler flags changed\n"; @@ -172,7 +172,7 @@ bool TaskCC::dirtyInner() } } - auto depList = readDeps(depsFile); + auto depList = readDeps(depsFile.string()); for(const auto& dep : depList) { if(!std::filesystem::exists(dep) || @@ -198,14 +198,14 @@ int TaskCC::runInner() { if(!std::filesystem::exists(sourceFile)) { - std::cout << "Missing source file: " << std::string(sourceFile) << "\n"; + std::cout << "Missing source file: " << sourceFile.string() << "\n"; return 1; } auto args = getCompilerArgs(); { // Write flags to file. - std::ofstream flagsStream(flagsFile); + std::ofstream flagsStream(flagsFile.string()); flagsStream << flagsString(); } @@ -223,19 +223,19 @@ int TaskCC::clean() { if(std::filesystem::exists(targetFile)) { - std::cout << "Removing " << std::string(targetFile) << "\n"; + std::cout << "Removing " << targetFile.string() << "\n"; std::filesystem::remove(targetFile); } if(std::filesystem::exists(depsFile)) { - std::cout << "Removing " << std::string(depsFile) << "\n"; + std::cout << "Removing " << depsFile.string() << "\n"; std::filesystem::remove(depsFile); } if(std::filesystem::exists(flagsFile)) { - std::cout << "Removing " << std::string(flagsFile) << "\n"; + std::cout << "Removing " << flagsFile.string() << "\n"; std::filesystem::remove(flagsFile); } @@ -249,7 +249,7 @@ std::vector TaskCC::depends() const std::string TaskCC::target() const { - return targetFile; + return targetFile.string(); } std::string TaskCC::toJSON() const @@ -309,9 +309,9 @@ std::vector TaskCC::getCompilerArgs() const } args.push_back("-c"); - args.push_back(std::string(sourceFile)); + args.push_back(sourceFile.string()); args.push_back("-o"); - args.push_back(std::string(targetFile)); + args.push_back(targetFile.string()); for(const auto& flag : compiler_flags) { -- cgit v1.2.3