-------------- Run: Debug in wx-sample (compiler: GNU GCC Compiler)---------------
Checking for existence: F\code\threepp\cb\bin\Debug\wx-sample.exe
Set variable: PATH=.;F\code\threepp\build\bin;D:/code/msys2/mingw64/lib;D:\code\msys2\mingw64\bin;D:\code\msys2\mingw64;C:\Windows\System32;C:\Windows;...
Set variable: PATH=D:\code\msys2\mingw64\bin;D:\code\msys2\mingw64\bin;D:\code\msys2\mingw64;C:\Windows\System32;C:\Windows;...
Executing: "F\code\threepp\cb\bin\Debug\wx-sample.exe" (in F\code\threepp\cb\.)
Look at the log above, it looks like the "Set variable: PATH" has run 2 times when I click the "Run" button.
The first time, the project's current folder "." (the dot), and the library search path (E:\F\code\threepp\build\bin) was already included in the PATH.
But I see the second time the PATH get restored.
The bad thing is: the executing happens after the PATH get restored.
// restore old dynamic linker path
wxSetEnv(CB_LIBRARY_ENVVAR, oldLibPath);
// restore old PATH environment
wxSetEnv("PATH", oldPath);
delete cmd;
return DoRunQueue();
}
The above code snippet is the last section of the DoRunQueue function, and I guess it has some recursive calls, and it looks like the actual running of the executable is inside the recursive call?
So, to solve this issue, maybe, we need to "restore" the PATH variable after the inner "DoRunQueue()"?