Library Targets Include Directories Broken
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- cmake, cpp
- 領域
- build-system
調査の方向性
cmake/draco_targets.cmake の draco_add_library の定義と、226、319、323 行付近の target_include_directories の呼び出しから始めてください。draco/draco_features.h がどのように生成されるか、またターゲットがサブプロジェクトまたはインストール済みライブラリとしてどのように利用されるかを確認してください。ビルド時とインストール時のインクルードパスが正しく機能し、機能マクロがライブラリの利用者から使用できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi folks, when using the draco library as a subproject, or with CMake's FetchContent/ExternalProject machinery, the draco includes are broken. This stems from the definition of the draco_add_library macro. Specifically, on line 226, the library target has the INSTALL_INTERFACE set at the include directory of the install folder. This works as intended. However, the BUILD_INTERFACE is not set at any point. Instead on lines 319 and 323 target_include_directories is called again to provide private and public directories, those these are not restricted to build time.
Now, my CMake experience does not include using macro wrappers around the typical target oriented machinery. Instead I am used to the modern CMake style of generator expressions. I worry that producing a large pull request reworking the CMake would not be accepted as it would be difficult to review.
So here is how I would address the issue: All of the library targets use the same build and install include directories. I would replace the referenced lines by the singular block:
target_include_directories(${lib_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/>
)
Now this doesn't address the generated draco/draco_features.h header, at least at build time. This CMake generated header defines a set of macros describing which features are supported. Instead this should be handled using the target_compile_definitions machinery. By setting these values publicly on the targets, both consumers of the installed library and the build time library will have those macros defined. The header can still be generated for backwards compatibility purposes as well.
- 主要言語
- C++
- スター
- 7.5k
- フォーク
- 1.1k
- 平均マージ
- 23時間 57分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/draco のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
documentation low priority
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
mattgodbolt/zindex#67 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
NKI-AI/fastslide#105 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
DarkCastleMUD/DarkCastle#283 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100