summaryrefslogtreecommitdiff
path: root/modules/SCsub
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-25 15:02:09 +0200
committerGitHub <noreply@github.com>2020-05-25 15:02:09 +0200
commit78f554a839c298698de899efcdf6f49b83179402 (patch)
tree0db690183390962cbfc2d15540d4b6bf57253dc1 /modules/SCsub
parentfee9742b59f8431fc6dbe2d0e8d3a6c400877c75 (diff)
parenta96f0e98d74839fecfe6ac553aa5a5521e69ddfd (diff)
Merge pull request #36922 from Xrayez/modules-search-path
Add `custom_modules` build option to compile external, user-defined C++ modules
Diffstat (limited to 'modules/SCsub')
-rw-r--r--modules/SCsub13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/SCsub b/modules/SCsub
index fb46c5f877..9155a53eaf 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -3,6 +3,7 @@
Import("env")
import modules_builders
+import os
env_modules = env.Clone()
@@ -13,16 +14,20 @@ env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_buil
vs_sources = []
# libmodule_<name>.a for each active module.
-for module in env.module_list:
+for name, path in env.module_list.items():
env.modules_sources = []
- SConscript(module + "/SCsub")
+
+ if not os.path.isabs(path):
+ SConscript(name + "/SCsub") # Built-in.
+ else:
+ SConscript(path + "/SCsub") # Custom.
# Some modules are not linked automatically but can be enabled optionally
# on iOS, so we handle those specially.
- if env["platform"] == "iphone" and module in ["arkit", "camera"]:
+ if env["platform"] == "iphone" and name in ["arkit", "camera"]:
continue
- lib = env_modules.add_library("module_%s" % module, env.modules_sources)
+ lib = env_modules.add_library("module_%s" % name, env.modules_sources)
env.Prepend(LIBS=[lib])
if env["vsproj"]:
vs_sources += env.modules_sources