P4: ss2pl/test の add_definitions を target_compile_definitions 化 (#60) - #73
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
cc/ss2pl/test/CMakeLists.txtに残っていた古いスタイルのディレクトリスコープadd_definitions(...)13 件を、target スコープのtarget_compile_definitions(<target> PRIVATE ...)に書き換えた。Closes #60
変更内容
-Dフラグ (ADD_ANALYSIS/BACK_OFF/KEY_SIZE/MASSTREE_USE/VAL_SIZE) はcmake/Options.cmakeのccbench_universal_definitions()ヘルパーで集約。本体プロトコル (cc/silo/CMakeLists.txtのreplay_test.exe等) と同じ universal flag を共有する。DLR1とKEY_SORTはcc/ss2pl/CMakeLists.txtのccbench_add_protocol(...)のOPTIONSに合わせ、target_compile_definitionsで個別に付与 (KEY_SORT=${CCBENCH_KEY_SORT})。if (DEFINED ...)の手書きデフォルト分岐はcmake/Options.cmakeの CACHE 変数にデフォルトが集約されているため不要になり削除。third_party/配下のadd_definitionsは外部 submodule のため touch していない。test plan
cmake -B build -DCMAKE_BUILD_TYPE=Release .: configure 緑。cc/ss2pl/test/CMakeLists.txtを単体 configure するスタンドアロンハーネスでmake_db_testをビルド確認。target_compile_definitionsが target-private flag として正しく適用されること (-DADD_ANALYSIS=0 -DBACK_OFF=1 -DDLR1 -DKEY_SIZE=8 -DKEY_SORT=0 -DMASSTREE_USE=1 -DVAL_SIZE=4) をflags.makeで確認。grep -rn 'add_definitions' --include='CMakeLists.txt' --include='*.cmake' .: プロジェクト本体のadd_definitions()呼び出しは 0 件 (ヒットするのはcmake/Options.cmake/cmake/ProtocolHelpers.cmakeのコメント文のみ、third_party/は対象外)。補足 (#60 のスコープ外)
cc/ss2pl/test/は #32 のリファクタ以降どのadd_subdirectoryからも参照されておらず、現状ビルドツリーに組み込まれていない。またmake_db_test.cppの#include "../../include/common.hh"は階層がずれた stale path になっている。いずれも本 issue (#60:add_definitionsの近代化) のスコープ外のため本 PR では触れていない。