Commit 26788729 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Hash all include files in run_action to force recompilation if any header changes

parent a962d139
......@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, string, hashlib, os.path, re
import sys, string, hashlib, os.path, re, glob
from .. import core
from .. import libgraph_tool_core
import numpy
......@@ -39,6 +39,11 @@ cxxflags = libgraph_tool_core.mod_info().cxxflags + " -I%s" % inc_prefix
support_template = open(prefix + "/run_action/run_action_support.hh").read()
code_template = open(prefix + "/run_action/run_action_template.hh").read()
# hash all the headers to force recompilation if code changes
headers_hash = ""
for inc in glob.glob(inc_prefix + "/*"):
headers_hash = hashlib.md5(headers_hash + open(inc).read()).hexdigest()
# property map types
props = """
typedef GraphInterface::vertex_index_map_t vertex_index_t;
......@@ -181,7 +186,7 @@ def inline(code, arg_names=[], local_dict=None,
extra_compile_args +\
extra_objects + \
extra_link_args) + \
core.__version__).hexdigest()
headers_hash + core.__version__).hexdigest()
code += "\n// support code hash: " + support_hash
inline_code = string.Template(globals()["code_template"]).\
substitute(var_defs=arg_def, var_extract=arg_conv,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment