How to build ONLY changed files?

Hello.
How to build and compile only changed files? I’m writing scripts now and I need to check them quickly, there is no time to build a whole project every time because of this :face_exhaling:. It takes a lot of time.
Thank you

I understand that I need to add such a line to the file CMakeLists.txt like set(ONLY_NEW_IF_CHANGED ON), but where exactly?

The compilation should already do that by default.
One issue is linking the compiled objects which usually takes a bit of time.

You should also be able to only build “scripts” project for example if you just want to test if the code compiles. But building the worldserver itself with everything linked together is needed if you are going to run the server.

Additionally, you could take a look at this system https://trinitycore.atlassian.net/wiki/spaces/tc/pages/18874377/Using+the+script+hotswapping+system
It allows building different parts of the core into DLLs/SOs, which allow you to compile and swap the scripts on the fly during runtime of the server. The compilation also doesnt need to link the scripts for example to the worldserver during compilation.

Hmm. Never seen or heard about ONLY_NEW_IF_CHANGED. Also not found on google or in TC source. What is that?