summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/replace/wafsamba.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/replace/wafsamba.py b/lib/replace/wafsamba.py
index 46a1ea86af..737a058086 100644
--- a/lib/replace/wafsamba.py
+++ b/lib/replace/wafsamba.py
@@ -314,15 +314,10 @@ Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
###############################################################
# add a new set of build rules from a subdirectory
+# the @runonce decorator ensures we don't end up
+# with duplicate rules
+@runonce
def BUILD_SUBDIR(bld, dir):
- try:
- cache = bld.cache_build_subdirs
- except AttributeError:
- bld.cache_build_subdirs = cache = {}
- abs_dir=os.path.normpath(bld.curdir + '/' + dir)
- if abs_dir in cache:
- return
- cache[abs_dir] = True
bld.add_subdirs(dir)
Build.BuildContext.BUILD_SUBDIR = BUILD_SUBDIR