Kde-builder - build single part

I set up a development environment for kde-builder to compile kcalc. That is working fine for me.
Now I would like to modify the code. To compile kcalc I changed to the build folder and executed make. This fails because there is no Makefile.
How do I make this run?

Compile it again with kde-builder. You don’t need to go to the build dir and run manually. Also, the reason there isn’t a Makefile is probably because Ninja was used instead.

Are you following Building KDE software with kde-builder | Developer ? I feel like maybe you want to Rebuild only a single project without updating the source code.

Of course I can use kde-builder again to compile the sources but it takes long. Now I used ninja -v in the build folder and this works.

1 Like

Could you elaborate? kde-builder will literally just call cmake which in turn just calls ninja under the hood, it shouldn’t be different.

Possibly its because of the num-cores defined in the kde-builder config?

I just want to give some details on my way of development. As example I use kalc as project.
For the initial set up I use kde-builder. That works really fine for me.
Suppose I change one line of code in kcalc I only want to compile kcalc. If I use kde-builder 28 parts are compiled. Till now I have not figured out how to set it that only kcalc is compiled.
So I was looking for a different approach. The hint to execute ninja in the build folder was very helpful and the main advantage is the reduced compilation time.
Is there another approach?

I’m guessing by 28 parts you mean projects, including the 27 dependencies needed for KCalc. I see that kde-builder --dry-run kcalc shows exactly 28 projects to build it.

The second link I mentioned earlier:

Lets you build only KCalc without building other dependencies. Namely:

kde-builder --no-include-dependencies --no-src kcalc

Or in its short form:

kde-builder -DS kcalc

This way you also get the nice bonus that you don’t need to cd to the build directory to build the project at all, you can run this command from anywhere.

2 Likes

Sorry I did not completely read your answer above.
Thank you very much for your detailed answer.
That is what I was looking for.

1 Like