Reputation: 194
I have a SCons build system set up to build some libraries from C++, as well as Python wrappers for them via SWIG. Then the results are used for data processing, which is also a part of SCons build. The data processing is Python scripts that use the built SWIG-wrapped libraries.
I've set up the dependencies such that data processing starts after all the libraries and wrappers are built, and that works out well. But there's a caveat (you guessed it, right? :) ). I want to add a source scanner, which also uses some of the SWIG libraries to expand the dependencies. The problem is that the scanner runs too soon. In fact, I see it running twice - once at some point early in the build and the other just before data processing starts. So the first scanner run in parallel build typically happens before all the necessary libraries are built, so it fails.
How can I make the scanner itself depend on library targets?
Or, can I delay the scanner run - or eliminate the first scanner run?
Any other ideas?
Upvotes: 0
Views: 228
Reputation: 1
Here's another potential solution which is kind of another workaround. Is it possible for the scanner to speculate the list of files that will be generated if the *.i swig interface files are passed to it as the "node" argument? This way the scanner doesn't actually need the files to be present to generate the list of dependencies.
In general, I'm wondering if the solution to this problem is to just write logic to aggressively speculate the dependencies before the SWIG libraries are actually generated. I don't assume much info can be gained from looking at the "_*.so" files themselves.
Upvotes: 0
Reputation: 194
One workaround I think would work is to turn the scanner into a builder that runs the scan process instead of scanner and generates a file that lists all the dependencies. The data processing build would then simply have a scanner to parse that file. I'd expect SCons not attempt to run it early, because it would be aware of the scanned source file being a target of some builder.
Assuming it works, it is still a sub-par solution as it complicates the build set up and adds extra file I/O of a not-so-small file (the dependencies are thousands of files, with long paths).
Upvotes: 1