[Scons-users] Generating header from cpp file causes cycle

Непомнящий Евгений johnny at topazelectro.ru
Sat Mar 25 08:04:25 EDT 2017


Hi Dirk

> Jean-Baptiste explained the underlying problem nicely. There is nothing  
> you've done wrong...neither is it a bug in SCons.

I think the problem is that in fact test.cpp does not depend on test.h -  
the contents of test.cpp does not change when test.h changes. But test.obj  
depends on both test.cpp and test.h.

As I understand it, scons "out of the box" makes test.cpp dependent on  
test.h. For myself, I solved this problem as follows:

copy = "test.cpp" + ".copy"
Execute (Copy(copy, "test.cpp")) # copy dont depends on anything
env.Generate (copy, "test.h")
env.Program ("test.cpp")

Perhaps there is a more elegant solution


More information about the Scons-users mailing list