summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-08 16:00:03 +0100
committerGitHub <noreply@github.com>2021-02-08 16:00:03 +0100
commitc05d205a5c2cd09731d8906ccad609131783cd33 (patch)
treeb2a140548ee1c95609ff0aa6d50f96b2a92f6aa0 /SConstruct
parentc31bceb5f524c76e1a8d986926cca2092ea29fe0 (diff)
parenta3c2c1e18a3b1ebcd06aabd71e98c53fd0e5e998 (diff)
Merge pull request #43057 from Xrayez/custom_modules_recursive
SCons: Add an option to detect C++ modules recursively
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct9
1 files changed, 8 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 065019d591..000c918808 100644
--- a/SConstruct
+++ b/SConstruct
@@ -120,6 +120,7 @@ opts.Add(BoolVariable("deprecated", "Enable deprecated features", True))
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False))
opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "")
+opts.Add(BoolVariable("custom_modules_recursive", "Detect custom modules recursively for each specified path.", True))
# Advanced options
opts.Add(BoolVariable("dev", "If yes, alias for verbose=yes warnings=extra werror=yes", False))
@@ -237,8 +238,14 @@ if env_base["custom_modules"]:
Exit(255)
for path in module_search_paths:
+ if path == "modules":
+ # Built-in modules don't have nested modules,
+ # so save the time it takes to parse directories.
+ modules = methods.detect_modules(path, recursive=False)
+ else: # External.
+ modules = methods.detect_modules(path, env_base["custom_modules_recursive"])
# Note: custom modules can override built-in ones.
- modules_detected.update(methods.detect_modules(path))
+ modules_detected.update(modules)
include_path = os.path.dirname(path)
if include_path:
env_base.Prepend(CPPPATH=[include_path])