2020-02-06 17:28:32 +01:00
|
|
|
"""Functions used to generate source files during build time
|
|
|
|
|
|
|
|
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from platform_methods import subprocess_main
|
|
|
|
|
|
|
|
|
|
|
|
def generate_modules_enabled(target, source, env):
|
2020-03-30 08:28:32 +02:00
|
|
|
with open(target[0].path, "w") as f:
|
2020-02-06 17:28:32 +01:00
|
|
|
for module in env.module_list:
|
2020-03-30 08:28:32 +02:00
|
|
|
f.write("#define %s\n" % ("MODULE_" + module.upper() + "_ENABLED"))
|
2020-02-06 17:28:32 +01:00
|
|
|
|
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if __name__ == "__main__":
|
2020-02-06 17:28:32 +01:00
|
|
|
subprocess_main(globals())
|