Clang ツールのグローバル設定を行う

Clang-Tidy および Clazy を使用して、C、C++、および Objective-C プログラムの問題を検出する。

Clang ツール向けに Clang 診断機能をグローバルに設定するには:

  1. Preferences 」>「Analyzer 」>「Clang Tools 」に移動します。

    アナライザーの設定にある「Clang Tools」タブ

  2. Clang-Tidy 」および「Clazy-Standalone 」フィールドに、使用する実行ファイルへのパスを設定します。
  3. Diagnostic configuration 」フィールドには、実行するチェックが表示されます。このフィールドの値を選択すると、「Diagnostic Configurations 」ダイアログが開き、そこで実行するチェックを選択・編集できます。

    代わりに Clang-Tidy 設定ファイルに基づいてチェックを実行するには、[Prefer .clang-tidy file, if present] を選択します。

  4. Clangツールを実行する前にプロジェクトをビルドするには、「Build the project before analysis 」を選択します。Clangツールでは、分析前にプロジェクトをビルドする必要はありませんが、ビルド中に生成されるファイルが見つからないという誤解を招く警告が表示される場合があります。大規模なプロジェクトの場合、プロジェクトをビルドしない方が時間を節約できる場合があります。
  5. 開いているドキュメントの自動解析を無効にするには、「Analyze open files 」のチェックを外してください。
  6. Parallel jobs 」フィールドで、マルチコアプロセッサでの解析を高速化するために並列実行するジョブの数を選択します。

Clang 診断の設定」、「Clang-Tidy および Clazy によるコードの分析」、「Clang ツールの設定の指定」、および「問題点も参照してください

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.