Created
March 21, 2017 05:45
-
-
Save mirajshah/2eb4bffe2c0363d67d1ab5af071af4e0 to your computer and use it in GitHub Desktop.
SCons MD5 Decider function to additionally check if targets have changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def modified_md5_decider(dependency, target, prev_ni): | |
"""SCons MD5 Decider function that checks if targets have changed""" | |
# Use default checking for changes in the source file | |
source_changed = dependency.changed_content(target, prev_ni) | |
if source_changed: | |
return source_changed | |
else: | |
target_changed = False | |
# If target node does not implement get_csig(), do not try to determine | |
# whether to rebuild. (csig = content signature) | |
try: | |
target_info = target.get_stored_info() | |
if target_info.ninfo.csig != target.get_csig(): | |
target_changed = True | |
except AttributeError: | |
pass | |
return target_changed | |
# Set the SCons Decider function | |
Decider(modified_md5_decider) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment