Skip to content

Commit

Permalink
refactor: compilation database ensures std
Browse files Browse the repository at this point in the history
fix #694
  • Loading branch information
alandefreitas committed Oct 10, 2024
1 parent 9871794 commit b5a36db
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/lib/Lib/MrDocsCompilationDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,18 @@ adjustCommandLine(
new_cmdline.emplace_back(target);
}();
}


// ------------------------------------------------------
// Language standard
// ------------------------------------------------------
constexpr auto is_std_option = [](std::string_view opt) {
return opt.starts_with("-std=") || opt.starts_with("--std=") || opt.starts_with("/std:");
};
if (std::ranges::find_if(cmdline, is_std_option) == cmdline.end())
{
new_cmdline.emplace_back("-std=c++23");
}

// ------------------------------------------------------
// Add additional defines
// ------------------------------------------------------
Expand Down

0 comments on commit b5a36db

Please sign in to comment.