Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def template_and_build(filepath, module_data):
# Don't import until here to reduce startup time.
import cppimport.templating as templating
import cppimport.build_module as build_module
quiet_print("Compiling " + filepath)
templating.run_templating(module_data)
build_module.build_module(module_data)
cppimport.checksum.checksum_save(module_data)
def check_checksum(module_data):
if cppimport.config.should_force_rebuild:
return False
if not cppimport.checksum.is_checksum_current(module_data):
return False
quiet_print("Matching checksum for " + module_data['filepath'] + " --> not compiling")
return True