modules_builders.py 551 B

123456789101112131415
  1. """Functions used to generate source files during build time"""
  2. def generate_modules_enabled(target, source, env):
  3. with open(target[0].path, "w", encoding="utf-8", newline="\n") as f:
  4. for module in env.module_list:
  5. f.write("#define %s\n" % ("MODULE_" + module.upper() + "_ENABLED"))
  6. def generate_modules_tests(target, source, env):
  7. import os
  8. with open(target[0].path, "w", encoding="utf-8", newline="\n") as f:
  9. for header in source:
  10. f.write('#include "%s"\n' % (os.path.normpath(header.path)))