diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-27 20:44:10 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-27 20:44:10 +0200 |
commit | cd36f59cac72920d1b46036da3ddcc82f7280c96 (patch) | |
tree | 14852454b16e38f14c57d8149a8519d14ed2294a | |
parent | 7731613f50eb45e5af9cd96e05fc7e43dc3643d1 (diff) |
Fix path to string conversions.
-rw-r--r-- | task_ar.cc | 14 | ||||
-rw-r--r-- | task_cc.cc | 20 | ||||
-rw-r--r-- | task_ld.cc | 16 | ||||
-rw-r--r-- | task_so.cc | 16 | ||||
-rw-r--r-- | tasks.cc | 2 |
5 files changed, 34 insertions, 34 deletions
@@ -51,7 +51,7 @@ TaskAR::TaskAR(const BuildConfiguration& config, { std::filesystem::path objectFile = object; objectFiles.push_back(objectFile); - dependsStr.push_back(objectFile); + dependsStr.push_back(objectFile.string()); } for(const auto& dep : config.depends) @@ -98,7 +98,7 @@ bool TaskAR::dirtyInner() } { - auto lastFlags = readFile(flagsFile); + auto lastFlags = readFile(flagsFile.string()); if(flagsString() != lastFlags) { //std::cout << "The compiler flags changed\n"; @@ -118,15 +118,15 @@ int TaskAR::runInner() { objectlist += " "; } - objectlist += std::string(objectFile); + objectlist += objectFile.string(); } std::vector<std::string> args; args.push_back("rcs"); - args.push_back(std::string(targetFile)); + args.push_back(targetFile.string()); for(const auto& objectFile : objectFiles) { - args.push_back(std::string(objectFile)); + args.push_back(objectFile.string()); } for(const auto& flag : config.ldflags) { @@ -161,13 +161,13 @@ int TaskAR::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(flagsFile)) { - std::cout << "Removing " << std::string(flagsFile) << "\n"; + std::cout << "Removing " << flagsFile.string() << "\n"; std::filesystem::remove(flagsFile); } @@ -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<std::string> TaskCC::depends() const std::string TaskCC::target() const { - return targetFile; + return targetFile.string(); } std::string TaskCC::toJSON() const @@ -309,9 +309,9 @@ std::vector<std::string> 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) { @@ -52,7 +52,7 @@ TaskLD::TaskLD(const BuildConfiguration& config, { std::filesystem::path objectFile = object; objectFiles.push_back(objectFile); - dependsStr.push_back(objectFile); + dependsStr.push_back(objectFile.string()); } for(const auto& dep : config.depends) @@ -99,7 +99,7 @@ bool TaskLD::dirtyInner() } { - auto lastFlags = readFile(flagsFile); + auto lastFlags = readFile(flagsFile.string()); if(flagsString() != lastFlags) { //std::cout << "The compiler flags changed\n"; @@ -119,13 +119,13 @@ int TaskLD::runInner() { objectlist += " "; } - objectlist += std::string(objectFile); + objectlist += objectFile.string(); } std::vector<std::string> args; for(const auto& objectFile : objectFiles) { - args.push_back(std::string(objectFile)); + args.push_back(objectFile.string()); } for(const auto& depFile : depFiles) @@ -147,7 +147,7 @@ int TaskLD::runInner() args.push_back(flag); } args.push_back("-o"); - args.push_back(std::string(targetFile)); + args.push_back(targetFile.string()); { // Write flags to file. std::ofstream flagsStream(flagsFile); @@ -167,13 +167,13 @@ int TaskLD::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(flagsFile)) { - std::cout << "Removing " << std::string(flagsFile) << "\n"; + std::cout << "Removing " << flagsFile.string() << "\n"; std::filesystem::remove(flagsFile); } @@ -198,7 +198,7 @@ std::vector<std::string> TaskLD::depends() const std::string TaskLD::target() const { - return std::string(targetFile); + return targetFile.string(); } std::string TaskLD::flagsString() const @@ -50,7 +50,7 @@ TaskSO::TaskSO(const BuildConfiguration& config, { std::filesystem::path objectFile = object; objectFiles.push_back(objectFile); - dependsStr.push_back(objectFile); + dependsStr.push_back(objectFile.string()); } for(const auto& dep : config.depends) @@ -97,7 +97,7 @@ bool TaskSO::dirtyInner() } { - auto lastFlags = readFile(flagsFile); + auto lastFlags = readFile(flagsFile.string()); if(flagsString() != lastFlags) { //std::cout << "The compiler flags changed\n"; @@ -117,7 +117,7 @@ int TaskSO::runInner() { objectlist += " "; } - objectlist += std::string(objectFile); + objectlist += objectFile.string(); } std::vector<std::string> args; @@ -126,11 +126,11 @@ int TaskSO::runInner() args.push_back("-shared"); args.push_back("-o"); - args.push_back(std::string(targetFile)); + args.push_back(targetFile.string()); for(const auto& objectFile : objectFiles) { - args.push_back(std::string(objectFile)); + args.push_back(objectFile.string()); } for(const auto& depFile : depFiles) @@ -161,13 +161,13 @@ int TaskSO::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(flagsFile)) { - std::cout << "Removing " << std::string(flagsFile) << "\n"; + std::cout << "Removing " << flagsFile.string() << "\n"; std::filesystem::remove(flagsFile); } @@ -192,7 +192,7 @@ std::vector<std::string> TaskSO::depends() const std::string TaskSO::target() const { - return std::string(targetFile); + return targetFile.string(); } std::string TaskSO::flagsString() const @@ -110,7 +110,7 @@ std::list<std::shared_ptr<Task>> getTasks(const Settings& settings) for(std::size_t i = 0; i < numConfigFiles; ++i) { std::string path = - std::filesystem::path(configFiles[i].file).parent_path(); + std::filesystem::path(configFiles[i].file).parent_path().string(); if(settings.verbose > 1) { std::cout << configFiles[i].file << " in path " << path << "\n"; |