1
votes

Well i have a build setup of 2 projects, one project takes .xml files from a directory and processes them into header files. These files are then used by the second project. Is there any way to check if his project needs to be re-run (the .xml files were modified or a new one was added)?

1
Please correct me, if I got it wrong: In project1 you do .xml->.h, and in project2 you're using the headers as created in project1. How exactly is project2 using the headers? Is it a standard C/CPP project, which scans for implicit dependencies automatically? - dirkbaechle
The headers get put into the include/ folder for the project, the generated header files contents are just structures mostly. The problem is creating the header files, i don't want to create them every build as some are quite large and take some time to create. But when i make changes to the .xml file, i want it to run, so checking on the header files to see if it needs to be built, if that's what you were thinking, wouldn't work i don't think. - user3901459

1 Answers

2
votes

Just combine the two projects into one common source tree, and one single SConstruct (with as many SConscripts as you like in the subfolders, that get included by SConscript(file) ).

Then ensure that the header files in the include/ folder are always tried to be built, e.g. by adding them as default targets with env.Default().

SCons will only call each conversion .xml->.h when the corresponding source XML file has changed its content.