libs found with check_lib should be added to LIBS - close #79

This commit is contained in:
Josh Holtrop 2018-12-17 23:05:18 -05:00
parent 5915ac2b95
commit 08085f09c4
3 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,9 @@
configure do configure do
check_lib "m" check_lib "m"
end end
build do
Environment.new(echo: :command) do |env|
env.Program("simple.exe", "simple.c")
end
end

View File

@ -178,6 +178,9 @@ module Rscons
} }
command = Environment.new.build_command("${LDCMD}", vars) command = Environment.new.build_command("${LDCMD}", vars)
_, _, status = log_and_test_command(command) _, _, status = log_and_test_command(command)
if status == 0
store_append({"LIBS" => [lib]}, options)
end
common_config_checks(status, options) common_config_checks(status, options)
end end

View File

@ -1773,6 +1773,15 @@ EOF
expect(result.status).to eq 0 expect(result.status).to eq 0
expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/ expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/
end end
it "links against the checked library by default" do
test_dir "configure"
result = run_rscons(rsconscript: "check_lib_success.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 match /gcc.*-lm/
end
end end
context "check_program" do context "check_program" do