preserve .mf dependency files - close #58

This commit is contained in:
josh committed 2019-01-01 21:17:28 -05:00
1 parent 918c629435
commit 9f9b7f0bf4
4 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -93,6 +93,7 @@ module Rscons
v.nil? and raise "Error: unknown input file type: #{sources.first.inspect}"
end.first
command = env.build_command("${#{com_prefix}CMD}", vars)
env.produces(target, vars['_DEPFILE'])
# Store vars back into options so new keys are accessible in #finalize.
options[:vars] = vars
standard_threaded_build("#{com_prefix} #{target}", target, command, sources, env, cache)
@@ -109,7 +110,6 @@ module Rscons
target, deps, cache, env, vars = options.values_at(:target, :sources, :cache, :env, :vars)
if File.exists?(vars['_DEPFILE'])
deps += Environment.parse_makefile_deps(vars['_DEPFILE'])
FileUtils.rm_f(vars['_DEPFILE'])
end
cache.register_build(target, options[:tc].command, deps.uniq, env)
target
+1 -1
View File
@@ -33,6 +33,7 @@ module Rscons
"_SOURCES" => sources,
"_DEPFILE" => Rscons.set_suffix(target, env.expand_varref("${DEPFILESUFFIX}", vars)))
command = env.build_command("${CPP_CMD}", vars)
env.produces(target, vars['_DEPFILE'])
# Store vars back into options so new keys are accessible in #finalize.
options[:vars] = vars
standard_threaded_build("#{name} #{target}", target, command, sources, env, cache)
@@ -49,7 +50,6 @@ module Rscons
target, deps, cache, env, vars = options.values_at(:target, :sources, :cache, :env, :vars)
if File.exists?(vars['_DEPFILE'])
deps += Environment.parse_makefile_deps(vars['_DEPFILE'])
FileUtils.rm_f(vars['_DEPFILE'])
end
cache.register_build(target, options[:tc].command, deps.uniq, env)
target
+1 -1
View File
@@ -78,6 +78,7 @@ module Rscons
v.nil? and raise "Error: unknown input file type: #{sources.first.inspect}"
end.first
command = env.build_command("${#{com_prefix}CMD}", vars)
env.produces(target, vars['_DEPFILE'])
# Store vars back into options so new keys are accessible in #finalize.
options[:vars] = vars
standard_threaded_build("#{com_prefix} #{target}", target, command, sources, env, cache)
@@ -94,7 +95,6 @@ module Rscons
target, deps, cache, env, vars = options.values_at(:target, :sources, :cache, :env, :vars)
if File.exists?(vars['_DEPFILE'])
deps += Environment.parse_makefile_deps(vars['_DEPFILE'])
FileUtils.rm_f(vars['_DEPFILE'])
end
cache.register_build(target, options[:tc].command, deps.uniq, env)
target
+6
View File
@@ -594,6 +594,12 @@ module Rscons
rv = builder.run(build_operation)
end
(@side_effects[build_operation[:target]] || []).each do |side_effect_file|
# Register side-effect files as build targets so that a Cache clean
# operation will remove them.
cache.register_build(side_effect_file, nil, [], self)
end
if rv.is_a?(ThreadedCommand)
# Store the build operation so the post-build hooks can be called
# with it when the threaded command completes.