modify Cache to store user-specified extra dependencies
This commit is contained in:
1 parent
a28cef9eb7
commit
7330e74ab8
9 files changed
+105
-46
No files matched your search
@@ -12,7 +12,7 @@ module Rscons
|
||||
}
|
||||
end
|
||||
|
||||
def run(target, sources, cache, env, vars)
|
||||
def run(target, sources, user_deps, cache, env, vars)
|
||||
# build sources to linkable objects
|
||||
objects = env.build_sources(sources, [env['OBJSUFFIX'], env['LIBSUFFIX']].flatten, cache, vars)
|
||||
if objects
|
||||
@@ -21,7 +21,7 @@ module Rscons
|
||||
'_SOURCES' => objects,
|
||||
})
|
||||
command = env.build_command(env['ARCMD'], vars)
|
||||
standard_build("AR #{target}", target, command, objects, env, cache)
|
||||
standard_build("AR #{target}", target, command, objects, user_deps, env, cache)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,7 +50,7 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
def run(target, sources, cache, env, vars)
|
||||
def run(target, sources, user_deps, cache, env, vars)
|
||||
vars = vars.merge({
|
||||
'_TARGET' => target,
|
||||
'_SOURCES' => sources,
|
||||
@@ -62,7 +62,7 @@ module Rscons
|
||||
v.nil? and raise "Error: unknown input file type: #{sources.first.inspect}"
|
||||
end.first
|
||||
command = env.build_command(env["#{com_prefix}CMD"], vars)
|
||||
unless cache.up_to_date?(target, command, sources)
|
||||
unless cache.up_to_date?(target, command, sources, user_deps)
|
||||
cache.mkdir_p(File.dirname(target))
|
||||
FileUtils.rm_f(target)
|
||||
return false unless env.execute("#{com_prefix} #{target}", command)
|
||||
@@ -71,7 +71,7 @@ module Rscons
|
||||
deps += Environment.parse_makefile_deps(vars['_DEPFILE'], target)
|
||||
FileUtils.rm_f(vars['_DEPFILE'])
|
||||
end
|
||||
cache.register_build(target, command, deps.uniq)
|
||||
cache.register_build(target, command, deps.uniq, user_deps)
|
||||
end
|
||||
target
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ module Rscons
|
||||
}
|
||||
end
|
||||
|
||||
def run(target, sources, cache, env, vars)
|
||||
def run(target, sources, user_deps, cache, env, vars)
|
||||
# build sources to linkable objects
|
||||
objects = env.build_sources(sources, [env['OBJSUFFIX'], env['LIBSUFFIX']].flatten, cache, vars)
|
||||
return false unless objects
|
||||
@@ -33,7 +33,7 @@ module Rscons
|
||||
'LD' => ld,
|
||||
})
|
||||
command = env.build_command(env['LDCMD'], vars)
|
||||
standard_build("LD #{target}", target, command, objects, env, cache)
|
||||
standard_build("LD #{target}", target, command, objects, user_deps, env, cache)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user