Place object files for absolute source paths under build_root - close #30

This commit is contained in:
josh committed 2017-05-29 12:16:46 -04:00
1 parent 1880e6650e
commit 8cbb9fa30e
6 files changed
+68 -7

No files matched your search

+5 -1
View File
@@ -71,7 +71,11 @@ module Rscons
#
# @return [Boolean] Whether the given path is an absolute filesystem path.
def absolute_path?(path)
path =~ %r{^(/|\w:[\\/])}
if RUBY_PLATFORM =~ /mingw/
path =~ %r{^(?:\w:)?[\\/]}
else
path.start_with?("/")
end
end
# Return whether the given target is a phony target.
+8 -3
View File
@@ -245,12 +245,17 @@ module Rscons
end
end
if @build_root and not found_match
unless Rscons.absolute_path?(source_fname) or build_fname.start_with?("#{@build_root}/")
if Rscons.absolute_path?(build_fname)
if build_fname =~ %r{^(\w):(.*)$}
build_fname = "#{@build_root}/_#{$1}#{$2}"
else
build_fname = "#{@build_root}/_#{build_fname}"
end
elsif !build_fname.start_with?("#{@build_root}/")
build_fname = "#{@build_root}/#{build_fname}"
end
end
build_fname.gsub!('\\', '/')
build_fname
build_fname.gsub('\\', '/')
end
# Get a construction variable's value.