Revise CMake scripts to support ninja on Linux #42283
Closed
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.
PR types
Others
PR changes
Others
Describe
修改 CMake 腳本使其支持 Linux 上的 Ninja 編譯
$(nproc)
的用法, 改為透過 CMake ProcessorCount 取得機器上核心數, 並用NPROC
變數紀錄使用, 以避開 Ninja 不支持$(var)
語法的問題gflags
下ExternalProjectAdd
中利用$(MAKE)
顯式調用BUILD_COMMAND
,INSTALL_COMMAND
的用法。ExternalProjectAdd
預設會用cmake --build .
來編譯 external projectrocksdb
的BYPRODUCTS
, 說明可參考這裡add_custom_target
對ps.pb.h
,ps.pb.cc
新增 target, 並且補齊afs_wrapper
對於ps.pb.h
的依賴, 因為 afs_wrapper.cc 會 includeps.pb.h