2024-03-11 19:05:37 +01:00
|
|
|
"""Functions used to generate source files during build time"""
|
2020-02-06 17:28:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
def generate_modules_enabled(target, source, env):
|
2024-03-09 21:29:24 +01:00
|
|
|
with open(target[0].path, "w", encoding="utf-8", newline="\n") 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-07-26 13:46:44 +02:00
|
|
|
def generate_modules_tests(target, source, env):
|
|
|
|
import os
|
|
|
|
|
2024-03-09 21:29:24 +01:00
|
|
|
with open(target[0].path, "w", encoding="utf-8", newline="\n") as f:
|
2022-02-08 12:39:40 +01:00
|
|
|
for header in source:
|
|
|
|
f.write('#include "%s"\n' % (os.path.normpath(header.path)))
|