Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6acb209ef4 | ||
|
|
43e12819d7 | ||
|
|
1bfb7dd100 | ||
|
|
df1e3be829 | ||
|
|
851adae66f | ||
|
|
eb28e09d8c |
No files matched your search
+6
-18
@@ -1,18 +1,6 @@
|
|||||||
*.gem
|
/.yardoc/
|
||||||
*.rbc
|
/_yardoc/
|
||||||
.bundle
|
/coverage/
|
||||||
.config
|
/doc/
|
||||||
.yardoc
|
/pkg/
|
||||||
Gemfile.lock
|
/build_test_run/
|
||||||
InstalledFiles
|
|
||||||
_yardoc
|
|
||||||
coverage
|
|
||||||
doc/
|
|
||||||
lib/bundler/man
|
|
||||||
pkg
|
|
||||||
rdoc
|
|
||||||
spec/reports
|
|
||||||
test/tmp
|
|
||||||
test/version_tmp
|
|
||||||
tmp
|
|
||||||
build_test_run
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
PATH
|
||||||
|
remote: .
|
||||||
|
specs:
|
||||||
|
rscons (1.6.1)
|
||||||
|
json (~> 1.0)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
diff-lcs (1.2.5)
|
||||||
|
docile (1.1.5)
|
||||||
|
json (1.8.1)
|
||||||
|
multi_json (1.10.1)
|
||||||
|
rake (10.3.2)
|
||||||
|
redcarpet (3.1.2)
|
||||||
|
rspec (3.0.0)
|
||||||
|
rspec-core (~> 3.0.0)
|
||||||
|
rspec-expectations (~> 3.0.0)
|
||||||
|
rspec-mocks (~> 3.0.0)
|
||||||
|
rspec-core (3.0.1)
|
||||||
|
rspec-support (~> 3.0.0)
|
||||||
|
rspec-expectations (3.0.1)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.0.0)
|
||||||
|
rspec-mocks (3.0.1)
|
||||||
|
rspec-support (~> 3.0.0)
|
||||||
|
rspec-support (3.0.0)
|
||||||
|
simplecov (0.8.2)
|
||||||
|
docile (~> 1.1.0)
|
||||||
|
multi_json
|
||||||
|
simplecov-html (~> 0.8.0)
|
||||||
|
simplecov-html (0.8.0)
|
||||||
|
yard (0.8.7.4)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
x86-mingw32
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rake
|
||||||
|
redcarpet
|
||||||
|
rscons!
|
||||||
|
rspec
|
||||||
|
simplecov
|
||||||
|
yard
|
||||||
@@ -329,6 +329,15 @@ http://rubydoc.info/github/holtrop/rscons/frames.
|
|||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
|
### v1.6.1
|
||||||
|
|
||||||
|
- add DEPFILESUFFIX construction variable to override dependency file suffix
|
||||||
|
- fix Environment#depends to expand its arguments for construction variables
|
||||||
|
|
||||||
|
### v1.6.0
|
||||||
|
|
||||||
|
- support lambdas as construction variable values
|
||||||
|
|
||||||
### v1.5.0
|
### v1.5.0
|
||||||
|
|
||||||
- add "json" as a runtime dependency
|
- add "json" as a runtime dependency
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ module Rscons
|
|||||||
def default_variables(env)
|
def default_variables(env)
|
||||||
{
|
{
|
||||||
'OBJSUFFIX' => '.o',
|
'OBJSUFFIX' => '.o',
|
||||||
|
'DEPFILESUFFIX' => '.mf',
|
||||||
|
|
||||||
'CPPDEFPREFIX' => '-D',
|
'CPPDEFPREFIX' => '-D',
|
||||||
'INCPREFIX' => '-I',
|
'INCPREFIX' => '-I',
|
||||||
@@ -87,7 +88,7 @@ module Rscons
|
|||||||
vars = vars.merge({
|
vars = vars.merge({
|
||||||
'_TARGET' => target,
|
'_TARGET' => target,
|
||||||
'_SOURCES' => sources,
|
'_SOURCES' => sources,
|
||||||
'_DEPFILE' => Rscons.set_suffix(target, '.mf'),
|
'_DEPFILE' => Rscons.set_suffix(target, env.expand_varref("${DEPFILESUFFIX}", vars)),
|
||||||
})
|
})
|
||||||
com_prefix = KNOWN_SUFFIXES.find do |compiler, suffix_var|
|
com_prefix = KNOWN_SUFFIXES.find do |compiler, suffix_var|
|
||||||
sources.first.end_with?(*env.expand_varref("${#{suffix_var}}"))
|
sources.first.end_with?(*env.expand_varref("${#{suffix_var}}"))
|
||||||
|
|||||||
@@ -351,7 +351,8 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def depends(target, *user_deps)
|
def depends(target, *user_deps)
|
||||||
target = target.to_s
|
target = expand_varref(target.to_s)
|
||||||
|
user_deps = user_deps.map {|ud| expand_varref(ud)}
|
||||||
@user_deps[target] ||= []
|
@user_deps[target] ||= []
|
||||||
@user_deps[target] = (@user_deps[target] + user_deps).uniq
|
@user_deps[target] = (@user_deps[target] + user_deps).uniq
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# gem version
|
# gem version
|
||||||
VERSION = "1.6.0"
|
VERSION = "1.6.1"
|
||||||
end
|
end
|
||||||
@@ -2,19 +2,31 @@ module Rscons
|
|||||||
module Builders
|
module Builders
|
||||||
describe Object do
|
describe Object do
|
||||||
let(:env) {Environment.new}
|
let(:env) {Environment.new}
|
||||||
|
let(:cache) {double(Cache)}
|
||||||
subject {Object.new}
|
subject {Object.new}
|
||||||
|
|
||||||
it "supports overriding CCCMD construction variable" do
|
it "supports overriding CCCMD construction variable" do
|
||||||
cache = "cache"
|
expect(cache).to receive(:up_to_date?).and_return(false)
|
||||||
allow(cache).to receive(:up_to_date?) { false }
|
expect(cache).to receive(:mkdir_p)
|
||||||
allow(cache).to receive(:mkdir_p) { }
|
expect(FileUtils).to receive(:rm_f)
|
||||||
allow(cache).to receive(:register_build) { }
|
|
||||||
allow(FileUtils).to receive(:rm_f) { }
|
|
||||||
allow(File).to receive(:exists?) { false }
|
|
||||||
expect(env).to receive(:execute).with("CC mod.o", ["llc", "mod.c"]).and_return(true)
|
expect(env).to receive(:execute).with("CC mod.o", ["llc", "mod.c"]).and_return(true)
|
||||||
|
expect(File).to receive(:exists?).and_return(false)
|
||||||
|
expect(cache).to receive(:register_build)
|
||||||
|
|
||||||
subject.run("mod.o", ["mod.c"], cache, env, "CCCMD" => ["llc", "${_SOURCES}"])
|
subject.run("mod.o", ["mod.c"], cache, env, "CCCMD" => ["llc", "${_SOURCES}"])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "supports overriding DEPFILESUFFIX construction variable" do
|
||||||
|
expect(cache).to receive(:up_to_date?).and_return(false)
|
||||||
|
expect(cache).to receive(:mkdir_p)
|
||||||
|
expect(FileUtils).to receive(:rm_f)
|
||||||
|
expect(env).to receive(:execute).with(anything, %w[gcc -c -o f.o -MMD -MF f.d in.c]).and_return(true)
|
||||||
|
expect(File).to receive(:exists?).with("f.d").and_return(false)
|
||||||
|
expect(cache).to receive(:register_build)
|
||||||
|
|
||||||
|
subject.run("f.o", ["in.c"], cache, env, "DEPFILESUFFIX" => ".d")
|
||||||
|
end
|
||||||
|
|
||||||
it "raises an error when given a source file with an unknown suffix" do
|
it "raises an error when given a source file with an unknown suffix" do
|
||||||
expect { subject.run("mod.o", ["mod.xyz"], :cache, env, {}) }.to raise_error /unknown input file type: "mod.xyz"/
|
expect { subject.run("mod.o", ["mod.xyz"], :cache, env, {}) }.to raise_error /unknown input file type: "mod.xyz"/
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -322,6 +322,13 @@ module Rscons
|
|||||||
env.depends("foo", "bar", "baz")
|
env.depends("foo", "bar", "baz")
|
||||||
expect(env.instance_variable_get(:@user_deps)).to eq({"foo" => ["bar", "baz"]})
|
expect(env.instance_variable_get(:@user_deps)).to eq({"foo" => ["bar", "baz"]})
|
||||||
end
|
end
|
||||||
|
it "expands arguments for construction variable references" do
|
||||||
|
env = Environment.new
|
||||||
|
env["foo"] = "foo.exe"
|
||||||
|
env["bar"] = "bar.c"
|
||||||
|
env.depends("${foo}", "${bar}", "a.h")
|
||||||
|
expect(env.instance_variable_get(:@user_deps)).to eq({"foo.exe" => ["bar.c", "a.h"]})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#build_sources" do
|
describe "#build_sources" do
|
||||||
|
|||||||
Reference in new issue
Block a user