I am trying to use a pre-build event in Visual Studio (in particular, VS 2005) to run a Python script that will automatically generate a .cpp file. The problem I am facing is that the compiler does not seem to know that this file is dirty and needs to be rebuilt before the build is complete, which means I need to build the solution twice - once to create this file and then one more time so that this file really compiles.
Unaware of the internal operation of the C ++ compiler, my naive guess is that it creates a list of dirty files that need to be recompiled before the pre-build event is triggered, so it skips this automatically generated file, since it was not affected until the event ended pre-assembly.
Is there a way to tell the compiler that it needs to recompile this file if the pre-build event changed it?
source
share