Compare commits

..

No commits in common. "precompile" and "master" have entirely different histories.

5 changed files with 9 additions and 61 deletions

View File

@ -33,7 +33,6 @@ module Rscons
:Lex, :Lex,
:Library, :Library,
:Object, :Object,
:Precompile,
:Preprocess, :Preprocess,
:Program, :Program,
:SharedLibrary, :SharedLibrary,
@ -153,7 +152,6 @@ require_relative "rscons/builders/disassemble"
require_relative "rscons/builders/lex" require_relative "rscons/builders/lex"
require_relative "rscons/builders/library" require_relative "rscons/builders/library"
require_relative "rscons/builders/object" require_relative "rscons/builders/object"
require_relative "rscons/builders/precompile"
require_relative "rscons/builders/preprocess" require_relative "rscons/builders/preprocess"
require_relative "rscons/builders/program" require_relative "rscons/builders/program"
require_relative "rscons/builders/shared_library" require_relative "rscons/builders/shared_library"

View File

@ -1,29 +0,0 @@
module Rscons
module Builders
# The Precompile builder generates .di interface files from .d source files
# for D.
class Precompile < Builder
# Run the builder to produce a build target.
def run(options)
if @command
finalize_command
else
if @sources.find {|s| s.end_with?(*@env.expand_varref("${DSUFFIX}", @vars))}
pcc = @env.expand_varref("${DC}")
if pcc =~ /ldc/
dpc_cmd = "${DPC_CMD:ldc}"
else
dpc_cmd = "${DPC_CMD:gdc}"
end
@vars["_TARGET"] = @target
@vars["_SOURCES"] = @sources
command = @env.build_command(dpc_cmd, @vars)
standard_command("Precompile <source>#{Util.short_format_paths(@sources)}<reset>", command)
end
end
end
end
end
end

View File

@ -43,8 +43,6 @@ module Rscons
"DFLAGS" => [], "DFLAGS" => [],
"DISASM_CMD" => %w[${OBJDUMP} ${DISASM_FLAGS} ${_SOURCES}], "DISASM_CMD" => %w[${OBJDUMP} ${DISASM_FLAGS} ${_SOURCES}],
"DISASM_FLAGS" => %w[--disassemble --source], "DISASM_FLAGS" => %w[--disassemble --source],
"DPC_CMD:ldc" => %w[${DC} -H -Hf ${_TARGET} -o- ${INCPREFIX}${D_IMPORT_PATH} ${DFLAGS} ${_SOURCES}],
"DPC_CMD:gdc" => %w[${DC} -H -Hf ${_TARGET} -fsyntax-only ${INCPREFIX}${D_IMPORT_PATH} ${DFLAGS} ${_SOURCES}],
"DSUFFIX" => %w[.d], "DSUFFIX" => %w[.d],
"D_IMPORT_PATH" => [], "D_IMPORT_PATH" => [],
"INCPREFIX" => "-I", "INCPREFIX" => "-I",

View File

@ -34,7 +34,15 @@ module Rscons
# #
# @return [Array<String>] Paths matching the specified pattern(s). # @return [Array<String>] Paths matching the specified pattern(s).
def glob(*patterns) def glob(*patterns)
Util.glob(*patterns) require "pathname"
patterns.reduce([]) do |result, pattern|
if pattern.end_with?("/**")
pattern += "/"
end
result += Dir.glob(pattern).map do |path|
Pathname.new(path.gsub("\\", "/")).cleanpath.to_s
end
end.sort
end end
# Download a file. # Download a file.

View File

@ -156,33 +156,6 @@ module Rscons
result result
end end
# Return a list of paths matching the specified pattern(s).
#
# A pattern can contain a "/**" component to recurse through directories.
# If the pattern ends with "/**" then only the recursive list of
# directories will be returned.
#
# Examples:
# - "src/**": return all directories under "src", recursively (including
# "src" itself).
# - "src/**/*": return all files and directories recursively under the src
# directory.
# - "src/**/*.c": return all .c files recursively under the src directory.
# - "dir/*/": return all directories in dir, but no files.
#
# @return [Array<String>] Paths matching the specified pattern(s).
def glob(*patterns)
require "pathname"
patterns.reduce([]) do |result, pattern|
if pattern.end_with?("/**")
pattern += "/"
end
result += Dir.glob(pattern).map do |path|
Pathname.new(path.gsub("\\", "/")).cleanpath.to_s
end
end.sort
end
# Make a relative path corresponding to a possibly absolute one. # Make a relative path corresponding to a possibly absolute one.
# #
# @param path [String] # @param path [String]