How to rebuild only changed files?
Answered
I have average size project. I do small change in main.cpp and do run/build
CLion call cmake to rebuild all.
Note: cmake alone can rebuild only changed files if exists compiled obj
Please sign in to leave a comment.
Now I check: sometimes build rebuilds only new files sometimes all files. Why?
Hello! If you would like to compile one file at a time without building the whole project, please use the Recompile action (Run | Recompile). Recompile is available for individual source and header files (for the latter, CLion uses resolve context to compile one of the source files that include the specified header). Note that Recompile is disabled for directories and non-C/C++ files.
FWIW I read somewhere earlier today that if you change a cpp file, then only that file will be compiled, however, if you change a header file it will have to recompile everything that touches that header file including all related implementation files.