| 475 | } |
| 476 | |
| 477 | QString CheckThread::clangTidyCmd() |
| 478 | { |
| 479 | QString path = QSettings().value(SETTINGS_CLANG_PATH,QString()).toString(); |
| 480 | if (!path.isEmpty()) |
| 481 | path += '/'; |
| 482 | path += "clang-tidy"; |
| 483 | #ifdef Q_OS_WIN |
| 484 | path += ".exe"; |
| 485 | #endif |
| 486 | |
| 487 | QProcess process; |
| 488 | process.start(path, QStringList() << "--version"); |
| 489 | process.waitForFinished(); |
| 490 | if (process.exitCode() == 0) |
| 491 | return path; |
| 492 | |
| 493 | #ifdef Q_OS_WIN |
| 494 | // Try to autodetect clang-tidy |
| 495 | if (QFileInfo("C:/Program Files/LLVM/bin/clang-tidy.exe").exists()) |
| 496 | return "C:/Program Files/LLVM/bin/clang-tidy.exe"; |
| 497 | #endif |
| 498 | |
| 499 | return QString(); |
| 500 | } |
| 501 | |