Write dependency file to build directory when user invokes Object builder directly - close #135
This commit is contained in:
parent
f011b23499
commit
2ee9dda49d
@ -75,10 +75,10 @@ module Rscons
|
||||
@vars["_SOURCES"] = @sources
|
||||
depfilesuffix = @env.expand_varref("${DEPFILESUFFIX}", vars)
|
||||
@vars["_DEPFILE"] =
|
||||
if @vars[:direct]
|
||||
@env.get_build_fname(target, depfilesuffix, self.class)
|
||||
if @vars[:direct] || !@target.start_with?("#{@env.build_root}/")
|
||||
@env.get_build_fname(@target, depfilesuffix, self.class)
|
||||
else
|
||||
"#{target}#{depfilesuffix}"
|
||||
"#{@target}#{depfilesuffix}"
|
||||
end
|
||||
@cache.mkdir_p(File.dirname(@vars["_DEPFILE"]))
|
||||
command = @env.build_command(@command_template, @vars)
|
||||
|
@ -1484,6 +1484,16 @@ EOF
|
||||
expect(File.exist?("simple.o")).to be_truthy
|
||||
end
|
||||
|
||||
it "writes the dependency file to the build root" do
|
||||
test_dir "simple"
|
||||
result = run_rscons(rsconscript: "distclean.rb")
|
||||
expect(result.stderr).to eq ""
|
||||
expect(result.stdout).to match /Compiling simple\.c/
|
||||
expect(File.exist?("simple.o")).to be_truthy
|
||||
expect(File.exist?("simple.o.mf")).to be_falsey
|
||||
expect(File.exist?("build/e.1/simple.o.mf")).to be_truthy
|
||||
end
|
||||
|
||||
context "debugging" do
|
||||
it "prints a message when the target does not exist" do
|
||||
test_dir("simple")
|
||||
|
Loading…
x
Reference in New Issue
Block a user