[docs] [ci] encourage use of cmake --build#6368
Merged
Conversation
cmake to drive more of the buildcmake --build
cmake --buildcmake --build
borchero
approved these changes
Mar 18, 2024
Collaborator
borchero
left a comment
There was a problem hiding this comment.
LGTM but I'm no cmake expert 😄
Collaborator
Author
|
Thanks @borchero !
Let's get one more review from @shiyu1994 / @guolinke |
Collaborator
|
A quick question: can we use |
Collaborator
Author
Definitely! This would work: cmake -B build -S .
make -j2 -C build _lightgbmThe cmake -B build -S .
cmake --build build
cmake -B build -S . -G Ninja
# this still works
#
# otherwise, would have to do 'ninja ...'
cmake --build build |
guolinke
approved these changes
Mar 20, 2024
Collaborator
Author
|
Thank you both! |
Contributor
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Contributes to #6350, and just generally to the goal of making it easier to develop against LightGBM.
Proposes replacing this pattern:
mkdir build cd build cmake -DSOME_OPTION=ON -DOTHER_OPTION=OFF .. make -j2 _lightgbmwith this
cmake -B build -S . -DSOME_OPTION=ON -DOTHER_OPTION=OFF cmake --build build --target _lightgbm -j2Benefits of this change
mkdirvs.mkdir -p, orcd-ing to the right place and passing a path like..)-G "Unix Makefiles"to-G "Ninja"and not need to change the build command)Notes for Reviewers
In case you're not familiar with this pattern in CMake, see the following: