include-what-you-use is included but is not presented as a CMake option

オープン 初心者向け
#161 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cmake
領域
build-system

調査の方向性

cmake/StaticAnalyzers.cmake と ProjectOptions.cmake の末尾から始め、include-what-you-use のパスを myproject_enable_clang_tidy および issue にリンクされている以前の実装と比較します。プロジェクトを構成するか cmake-gui を開いて、include-what-you-use オプションが公開されていることと、それを有効にすると既存のマクロに到達することを確認します。

索引モデルが issue の本文から書いたものです。

説明

In /cmake/StaticAnalyzers.cmake, the macro myproject_enable_include_what_you_use is declared.

However, myproject_enable_include_what_you_use is never actually set as an option elsewhere. Therefore, it's not possible to set it as an option in places like cmake-gui or based on the configuration.

For instance, myproject_enable_clang_tidy is right above it. I see that at the bottom of ProjectOptions.cmake that macro is called if myproject_ENABLE_CLANG_TIDY is set to true. There is no equivalent for myproject_enable_include_what_you_use.

It appears when iwyu was added, https://github.com/cpp-best-practices/cmake_template/blob/3a8c8f9793fb9805af558bfe097491e9a6efc97c/cmake/StaticAnalyzers.cmake was simpler. It did have option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF).

StaticAnalyzers.cmake has had some changes, but it appears

macro(myproject_enable_include_what_you_use)
  find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
  if(INCLUDE_WHAT_YOU_USE)
    set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
  else()
    message(WARNING "include-what-you-use requested but executable not found")
  endif()
endmacro()

is orphaned code that doesn't do anything. If I am mistaken hopefully, someone can explain this a little bit better to me. I've had to heavily edit my fork of this template because we can only support CMake 3.12 at this time, due to our usage of MSVS 2017. I'm doing some cleanup and noticed that iwyu is never really used. Looking at the code on the main branch, I don't see it being used so it's not like I unintentionally removed it.

主要言語
CMake
スター
1.8k
フォーク
205
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cpp-best-practices/cmake_template のほかの issue

cpp-best-practices/cmake_template の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。