support false :use value for configure operations - close #93
This commit is contained in:
parent
f58744d31f
commit
06b9c98ed0
10
build_tests/configure/check_lib_use_false.rb
Normal file
10
build_tests/configure/check_lib_use_false.rb
Normal file
@ -0,0 +1,10 @@
|
||||
configure do
|
||||
check_lib "m", use: false
|
||||
end
|
||||
|
||||
build do
|
||||
Environment.new(echo: :command) do |env|
|
||||
env.Copy("test1.c", "simple.c")
|
||||
env.Program("test2.exe", "test1.c")
|
||||
end
|
||||
end
|
@ -360,15 +360,19 @@ module Rscons
|
||||
# @return [Hash]
|
||||
# Configuration Hash for storing vars.
|
||||
def store_common(options)
|
||||
usename =
|
||||
if options[:use]
|
||||
options[:use].to_s
|
||||
else
|
||||
"_default_"
|
||||
end
|
||||
cache = Cache.instance
|
||||
cache["configuration_data"]["vars"] ||= {}
|
||||
cache["configuration_data"]["vars"][usename] ||= {}
|
||||
if options[:use] == false
|
||||
{}
|
||||
else
|
||||
usename =
|
||||
if options[:use]
|
||||
options[:use].to_s
|
||||
else
|
||||
"_default_"
|
||||
end
|
||||
cache = Cache.instance
|
||||
cache["configuration_data"]["vars"] ||= {}
|
||||
cache["configuration_data"]["vars"][usename] ||= {}
|
||||
end
|
||||
end
|
||||
|
||||
# Perform processing common to several configure checks.
|
||||
|
@ -1806,6 +1806,15 @@ EOF
|
||||
expect(result.stdout).to_not match /gcc.*test1.*-lm/
|
||||
expect(result.stdout).to match /gcc.*test2.*-lm/
|
||||
end
|
||||
|
||||
it "does not link against the checked library if :use is set to false" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(rsconscript: "check_lib_use_false.rb", op: "build")
|
||||
expect(result.stderr).to eq ""
|
||||
expect(result.status).to eq 0
|
||||
expect(result.stdout).to match /Checking for library 'm'... found/
|
||||
expect(result.stdout).to_not match /-lm/
|
||||
end
|
||||
end
|
||||
|
||||
context "check_program" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user