PreprocessBuild add script define

I have written my method which adds a new script define, I call it in the preprocess build script and for the test after the adding method there is a fragment marked compile directive with Debug.Log, unfortunately this code does not execute, only during the second build it executes. Is it possible to refresh the code after adding the script define in the preprocess script?

Code:

public class PreProcessTest : IPreprocessBuildWithReport
{
    public int callbackOrder { get; }
    public void OnPreprocessBuild(BuildReport report)
    {
        AddScriptDefine("TEST_SCRIPT_DEFINE");
       
        #if TEST_SCRIPT_DEFINE

        Debug.Log("Test!");
        #endif
       
        Debug.Log("End");
    }

    private static void AddScriptDefine(string scriptDefine)
    {
        PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, out string[] defines);

        string[] newDefines = new string[defines.Length + 1];

        for (int i = 0; i < defines.Length; i++)
            newDefines[i] = defines[i];

        newDefines[newDefines.Length - 1] = scriptDefine;

        PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, newDefines);
    }

That is not going to work because of how defines work.

After adding a define the code needs to be recompiled, so the first time the preprocessor is executed, the define is not there, BUT, after that first execution, the reloaded assemblies will have the defines.

Check this if you have any doubt.