add Environment#depends() to specify user dependencies for a build target
This commit is contained in:
1 parent
7330e74ab8
commit
295324eafd
3 files changed
+54
-1
No files matched your search
@@ -26,6 +26,7 @@ module Rscons
|
||||
def initialize(options = {})
|
||||
@varset = VarSet.new
|
||||
@targets = {}
|
||||
@user_deps = {}
|
||||
@builders = {}
|
||||
@build_dirs = []
|
||||
@build_hooks = []
|
||||
@@ -147,7 +148,7 @@ module Rscons
|
||||
result = run_builder(@targets[target][:builder],
|
||||
target,
|
||||
@targets[target][:source],
|
||||
[],
|
||||
@user_deps[target] || [],
|
||||
cache,
|
||||
@targets[target][:vars] || {})
|
||||
unless result
|
||||
@@ -221,6 +222,13 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Manually record a given target as depending on the specified
|
||||
# dependency files.
|
||||
def depends(target, *user_deps)
|
||||
@user_deps[target] ||= []
|
||||
@user_deps[target] = (@user_deps[target] + user_deps).uniq
|
||||
end
|
||||
|
||||
# Build a list of source files into files containing one of the suffixes
|
||||
# given by suffixes.
|
||||
# This method is used internally by RScons builders.
|
||||
|
||||
Reference in new issue
Block a user