-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[docs] [ci] encourage use of cmake --build
#6368
Conversation
cmake
to drive more of the buildcmake --build
cmake --build
cmake --build
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 but I'm no cmake
expert 😄
Thanks @borchero !
Let's get one more review from @shiyu1994 / @guolinke |
A quick question: can we use |
Definitely! This would work: cmake -B build -S .
make -j2 -C build _lightgbm The 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 |
Thank you both! |
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 _lightgbm
with this
cmake -B build -S . -DSOME_OPTION=ON -DOTHER_OPTION=OFF cmake --build build --target _lightgbm -j2
Benefits of this change
mkdir
vs.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: