summaryrefslogtreecommitdiff
path: root/modules/SCsub
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-06 17:28:32 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-07 11:31:37 +0100
commitb7297fb39ca7a55390f9390666bd29803adc827f (patch)
treed5e6f977177db1beab58745fbb53205e9c741e79 /modules/SCsub
parent00f46452b0206afe6aca79b0c4cd4a205f99067b (diff)
SCons: Generate header with info on which modules are enabled
We already had `MODULE_*_ENABLED` defines but only in the modules environment, and a few custom `*_ENABLED` defines in the main env when we needed the information in core. Now this is defined in a single header which can be included in the files that need this information.
Diffstat (limited to 'modules/SCsub')
-rw-r--r--modules/SCsub12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/SCsub b/modules/SCsub
index dc0420616c..75483fd637 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -2,19 +2,19 @@
Import('env')
+import modules_builders
+
env_modules = env.Clone()
Export('env_modules')
-env.modules_sources = []
+env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_builders.generate_modules_enabled)
+env.modules_sources = []
env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp")
-for x in env.module_list:
- if (x in env.disabled_modules):
- continue
- env_modules.Append(CPPDEFINES=["MODULE_" + x.upper() + "_ENABLED"])
- SConscript(x + "/SCsub")
+for module in env.module_list:
+ SConscript(module + "/SCsub")
if env['split_libmodules']:
env.split_lib("modules", env_lib = env_modules)