[Python] set defines in compiled modules
Problem
The SimpleGenerator.load
method takes a defines
argument that can be used to set preprocess defines in the generator C++ code. At the moment that is added to the files before the includes are written into the files. See dune-common/python/dune/generator/generator.py
source += ''.join(["#define " + d + "\n" for d in defines])
source += ''.join(["#include <" + i + ">\n" for i in includes])
But these defines are not added to the generated python module instance so that they are not set in modules further down the lines (includes are added).
This is probably not the expected behavior.
Solution
We could add a cppDefines
property. But we should perhaps consider adding a dictionary to the modules collecting 1cpp
properties of the module needed downstream to make it easier to extend the jit module generation process.