fix variable references that expand to arrays in build target sources - fix #20
This commit is contained in:
parent
cb3cc9a0de
commit
76610a07a9
@ -388,6 +388,7 @@ http://rubydoc.info/github/holtrop/rscons/frames.
|
|||||||
- fix Rscons.set_suffix to append the given suffix if the filename has none
|
- fix Rscons.set_suffix to append the given suffix if the filename has none
|
||||||
- rework Preprocess builder to consider deep dependencies
|
- rework Preprocess builder to consider deep dependencies
|
||||||
- remove ${CFLAGS} from default CPP_CMD
|
- remove ${CFLAGS} from default CPP_CMD
|
||||||
|
- fix variable references that expand to arrays in build target sources
|
||||||
|
|
||||||
### v1.8.1
|
### v1.8.1
|
||||||
|
|
||||||
|
@ -683,7 +683,7 @@ module Rscons
|
|||||||
sources = target_params[:sources].map do |source|
|
sources = target_params[:sources].map do |source|
|
||||||
source = expand_path(source) if @build_root
|
source = expand_path(source) if @build_root
|
||||||
expand_varref(source)
|
expand_varref(source)
|
||||||
end
|
end.flatten
|
||||||
target = expand_path(target) if @build_root
|
target = expand_path(target) if @build_root
|
||||||
target = expand_varref(target)
|
target = expand_varref(target)
|
||||||
result[target] = target_params.merge(sources: sources)
|
result[target] = target_params.merge(sources: sources)
|
||||||
|
@ -754,4 +754,14 @@ EOF
|
|||||||
expect(File.read("pp")).to match(%r{abc88xyz}m)
|
expect(File.read("pp")).to match(%r{abc88xyz}m)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows construction variable references which expand to arrays in sources of a build target" do
|
||||||
|
test_dir("simple")
|
||||||
|
Rscons::Environment.new do |env|
|
||||||
|
env["sources"] = Dir["*.c"]
|
||||||
|
env.Program("simple", "${sources}")
|
||||||
|
end
|
||||||
|
expect(File.exists?("simple.o")).to be_truthy
|
||||||
|
expect(`./simple`).to eq "This is a simple C program\n"
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user