Clion builds target for already build targets... slow compile
Hey
Long story short, I had an app that had a lot of "classes" internally. I've latelly splitted everything up and ended up with about 20 targets.
The problem I'm having is that when I had 1 app, 1 target, my cpu was going 100% and it was compiling quickly.
But now the compile is slow because
1. It seems to no longer multithread as well as it did before with 1 target
2. On each compile, even if there were no changes, it takes around 5 secs per target to "Built target xxx" / "Built target autogen"
QtCreator does not do that at all, I can spam compile as much as I want there and it always start straight away where as clion takes 1-2 min to start.
How can I tell clion to not build targets if they are already built and unchanged?
I'm at loss as how to optimize it.
Please sign in to leave a comment.
Hello!
>It seems to no longer multithread as well as it did before with 1 target
You can check the -- -j <number> option in the Messages window. By the way, what toolchain do you use? On what platform?
>On each compile, even if there were no changes, it takes around 5 secs per target to "Built target xxx" / "Built target autogen"
Actually, we just launch CMake. How your project behave if you build it in terminal?
Also you can try using the Ninja CMake generator: https://www.jetbrains.com/help/clion/cmake-profile.html#cmake-generators.