modules_builders.py 471 B

1234567891011121314151617
  1. """Functions used to generate source files during build time
  2. All such functions are invoked in a subprocess on Windows to prevent build flakiness.
  3. """
  4. from platform_methods import subprocess_main
  5. def generate_modules_enabled(target, source, env):
  6. with open(target[0].path, "w") as f:
  7. for module in env.module_list:
  8. f.write("#define %s\n" % ("MODULE_" + module.upper() + "_ENABLED"))
  9. if __name__ == "__main__":
  10. subprocess_main(globals())