modify Cache to store user-specified extra dependencies

This commit is contained in:
josh committed 2013-12-27 14:20:32 -05:00
1 parent a28cef9eb7
commit 7330e74ab8
9 files changed
+105 -46

No files matched your search

+2 -2
View File
@@ -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
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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