diff --git a/src/V3EmitCMake.cpp b/src/V3EmitCMake.cpp index 902cd0526..06ef3be8f 100644 --- a/src/V3EmitCMake.cpp +++ b/src/V3EmitCMake.cpp @@ -214,8 +214,7 @@ class CMakeEmitter final { << hblockp->modp()->name() << " DIRECTORY " << v3Global.opt.makeDir() + "/" + prefix << " SOURCES "; for (const auto& childr : children) { - *of << " " - << v3Global.opt.makeDir() + "/" + childr->hierWrapper(true); + *of << " " << v3Global.opt.makeDir() + "/" + childr->hierWrapper(true); } *of << " "; const string vFile = hblockp->vFileIfNecessary(); @@ -233,8 +232,7 @@ class CMakeEmitter final { << v3Global.rootp()->topModulep()->name() << " DIRECTORY " << v3Global.opt.makeDir() << " SOURCES "; for (const auto& itr : *planp) { - *of << " " - << v3Global.opt.makeDir() + "/" + itr.second->hierWrapper(true); + *of << " " << v3Global.opt.makeDir() + "/" + itr.second->hierWrapper(true); } *of << " " << cmake_list(v3Global.opt.vFiles()); *of << " VERILATOR_ARGS "; diff --git a/src/V3String.cpp b/src/V3String.cpp index a688958e4..58369df21 100644 --- a/src/V3String.cpp +++ b/src/V3String.cpp @@ -116,13 +116,14 @@ string VString::quoteStringLiteralForShell(const string& str) { return result; } -string VString::escapeStringForPath(const string &str) { - if (str.find(R"(\\)") != string::npos) return str; // if it has been escaped already, don't do it again - if (str.find('/') != string::npos) return str; // can be replaced by `__MINGW32__` or `_WIN32` +string VString::escapeStringForPath(const string& str) { + if (str.find(R"(\\)") != string::npos) + return str; // if it has been escaped already, don't do it again + if (str.find('/') != string::npos) return str; // can be replaced by `__MINGW32__` or `_WIN32` string result; - const char space = ' '; // escape space like this `Program Files` + const char space = ' '; // escape space like this `Program Files` const char escape = '\\'; - for (const char c: str) { + for (const char c : str) { if (c == space || c == escape) result.push_back(escape); result.push_back(c); } diff --git a/src/V3String.h b/src/V3String.h index 5cbd32402..bad040651 100644 --- a/src/V3String.h +++ b/src/V3String.h @@ -102,7 +102,8 @@ public: // e.g. input abc's becomes "\"abc\'s\"" static string escapeStringForPath(const string& str); // Escape path in Windows - // e.g. input `C:\Program Files\My Program\My Program.exe` becomes `C:\\Program\ Files\\My\ Program\\My\ Program.exe` + // e.g. input `C:\Program Files\My Program\My Program.exe` becomes + // `C:\\Program\ Files\\My\ Program\\My\ Program.exe` static string quoteStringLiteralForShell(const string& str); // Replace any unprintable with space // This includes removing tabs, so column tracking is correct