Skip to content

Commit eed31e5

Browse files
committed
find clang
1 parent 818adf9 commit eed31e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/MrDocsSettingsDB.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "MrDocsSettingsDB.hpp"
1313
#include <mrdocs/Support/Path.hpp>
14+
#include <llvm/Support/Program.h>
1415

1516
namespace clang {
1617
namespace mrdocs {
@@ -59,18 +60,18 @@ MrDocsSettingsDB::MrDocsSettingsDB(ConfigImpl const& config)
5960
return {};
6061
});
6162
}
63+
64+
llvm::ErrorOr<std::string> clangPath = llvm::sys::findProgramByName("clang");
6265

6366
for (auto const& pathName: sourceFiles)
6467
{
6568
// auto fileName = files::getFileName(pathName);
6669
auto parentDir = files::getParentDir(pathName);
6770

6871
std::vector<std::string> cmds;
69-
cmds.emplace_back("clang");
72+
cmds.emplace_back(clangPath ? *clangPath : "clang");
7073
cmds.emplace_back("-fsyntax-only");
7174
cmds.emplace_back("-std=c++23");
72-
cmds.emplace_back("-pedantic-errors");
73-
cmds.emplace_back("-Werror");
7475
cmds.emplace_back("-x");
7576
cmds.emplace_back("c++");
7677
cmds.emplace_back(pathName);

0 commit comments

Comments
 (0)