-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GoogleTestを更新する #1779
GoogleTestを更新する #1779
Conversation
Kudos, SonarCloud Quality Gate passed! |
✅ Build sakura 1.0.4011 completed (commit 5d86f04141 by @kazasaku) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良いと思います。
なんでNuGet使わないんでしょう?とか
そろそろvcpkgの採用を検討してもよいのでは?とか
周辺課題がありそうに思いました。
CIが通ったのでDraft外します。
なんか単体テスト周りを触るたびに(他への移行も含めて)話題が出る気がしますね。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
gtestd.libを作って参照させる機構は頑張って作ったような気がしますが、消すのは構わないです。
これはlibフォルダにdebugとreleaseの両方を置くための「伝統スタイル」ですが、最近はdebugビルドはreleaseビルドと別フォルダに出力するようになってきたので「ファイル名まで変えるの意味なくね?」になったと予想します。
記憶があやふやですが、vs2017に付属するCMakeのバージョンは当初から 3.x 系だった気がします。 CMake対応の検討PRに、やたらと古いrequireの記載があり、 |
レビューありがとうございました。マージします。
リリースノートだと3.11に更新されているらしいですが、もっと新しいかもしれません。 |
PR の目的
CMakeの警告メッセージに対処するため、GoogleTestを更新する。
カテゴリ
PR の背景
先日find-toolsのログを #1759 に投稿しましたが、その時に次のようなメッセージが出ていることに気が付きました。
ログにある通りですが、GoogleTest側のCMakeLists.txtの内容に関するものです。
CMakeでは「2.8.12より前のバージョンとの互換性を廃止する」計画があり、3.19以降のバージョンでは予告メッセージが表示されます。
Deprecated and Removed Features | CMake 3.19 Release Notes
現在サクラエディタで使っているGoogleTestは2018年11月21日版ですが、この版はCMake 2.8.8に対応しているため予告メッセージの表示対象となりました。
しかし、この仕様変更予告は2020年12月29日版ですでに対応済みであり、これ以降の版では表示されません。
これを機に最新のGoogleTestへ更新を行いたいです。
PR のメリット
PR のデメリット (トレードオフとかあれば)
仕様・動作説明
サブモジュールの更新と、それに伴うビルドエラーへの対処を実施しています。
targetsファイルとMakefileの変更について
つい先日GoogleTestのビルド設定に変更( google/googletest@f64cf6b )があり、CMakeの
DEBUG_POSIFIX
オプションが設定されなくなりました。GoogleTestのライブラリファイルはデバッグ版とリリース版でファイル名が異なっていましたが、この変更によりどちらも同じファイル名になります。
サクラエディタ側ではビルド構成に応じてファイル名にプレフィクスを付加する対応を行っていますが、不要になりましたので削除しました。
補足情報
Visual Studioに付属するCMakeのバージョンは、手元で確認した限りでは次の通りでした。
cmake version 3.20.21032501-MSVC_2
cmake version 3.21.21080301-MSVC_2
PR の影響範囲
単体テスト
テスト内容
git submodule update
を実行してサブモジュールを更新する関連 issue, PR
#636 前回は2018年11月23日に行いました。
参考資料