Skip to content

Commit

Permalink
fix parsing of msvc /std option (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Aug 27, 2024
1 parent 960a3d3 commit 960be69
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool ImportProject::fsParseCommand(FileSettings& fs, const std::string& command)
while (pos < command.size() && command[pos] == ' ')
++pos;
}
const std::string fval = readUntil(command, &pos, " =:");
const std::string fval = readUntil(command, &pos, " =");
if (F=='D') {
std::string defval = readUntil(command, &pos, " ");
defs += fval;
Expand All @@ -309,8 +309,12 @@ bool ImportProject::fsParseCommand(FileSettings& fs, const std::string& command)
if (std::find(fs.includePaths.cbegin(), fs.includePaths.cend(), i) == fs.includePaths.cend())
fs.includePaths.push_back(std::move(i));
} else if (F=='s' && startsWith(fval,"td")) {
++pos;
fs.standard = readUntil(command, &pos, " ");
if (command[pos] == '=') {
++pos;
fs.standard = readUntil(command, &pos, " ");
} else {
fs.standard = fval.substr(3);
}
bool unknown_std = false;
(void)Standards::getCPP(fs.standard, unknown_std);
if (unknown_std) (void)Standards::getC(fs.standard, unknown_std);
Expand Down

0 comments on commit 960be69

Please sign in to comment.