fix dependency parsing with ldc2 - close #110
This commit is contained in:
1 parent
2385874f4a
commit
1e157c79ec
7 files changed
+72
-8
No files matched your search
@@ -9,7 +9,7 @@ module Rscons
|
||||
def finalize_command_with_depfile
|
||||
deps = @sources
|
||||
if File.exists?(@vars["_DEPFILE"])
|
||||
deps += Util.parse_makefile_deps(@vars["_DEPFILE"])
|
||||
deps += Util.parse_dependency_file(@vars["_DEPFILE"])
|
||||
end
|
||||
@cache.register_build(@target, @command, deps.uniq, @env)
|
||||
true
|
||||
|
||||
@@ -479,6 +479,7 @@ module Rscons
|
||||
"DC" => dc,
|
||||
"DCCMD" => env["DCCMD"].map {|e| if e == "-o"; "-of"; else; e; end},
|
||||
"LDCMD" => env["LDCMD"].map {|e| if e == "-o"; "-of"; else; e; end},
|
||||
"DDEPGEN" => ["-deps=${_DEPFILE}"],
|
||||
}
|
||||
end
|
||||
_, _, status = log_and_test_command(command)
|
||||
|
||||
+7
-3
@@ -160,7 +160,7 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Parse dependencies from a Makefile.
|
||||
# Parse dependencies from a Makefile or ldc2 dependency file.
|
||||
#
|
||||
# This method is used internally by Rscons builders.
|
||||
#
|
||||
@@ -169,7 +169,7 @@ module Rscons
|
||||
#
|
||||
# @return [Array<String>]
|
||||
# Paths of dependency files.
|
||||
def parse_makefile_deps(mf_fname)
|
||||
def parse_dependency_file(mf_fname)
|
||||
deps = []
|
||||
buildup = ''
|
||||
File.read(mf_fname).each_line do |line|
|
||||
@@ -177,7 +177,11 @@ module Rscons
|
||||
buildup += ' ' + $1
|
||||
else
|
||||
buildup += ' ' + line
|
||||
if buildup =~ /^.*: (.*)$/
|
||||
if buildup =~ /^[^:]+\(\S+\)\s*:.*?:[^:]+\((\S+)\)/
|
||||
# ldc2-style dependency line
|
||||
deps << $1
|
||||
elsif buildup =~ /^.*: (.*)$/
|
||||
# Makefile-style dependency line
|
||||
mf_deps = $1
|
||||
deps += mf_deps.split(' ').map(&:strip)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user