Avoid running configure operation twice - close #156
This commit is contained in:
parent
e3ea429253
commit
b932380b3b
5
build_tests/configure/configure_with_top_level_env.rb
Normal file
5
build_tests/configure/configure_with_top_level_env.rb
Normal file
@ -0,0 +1,5 @@
|
||||
configure do
|
||||
check_c_compiler
|
||||
end
|
||||
env do |env|
|
||||
end
|
@ -207,15 +207,18 @@ module Rscons
|
||||
#
|
||||
# @return [void]
|
||||
def configure
|
||||
co = ConfigureOp.new(@script)
|
||||
begin
|
||||
@script.configure(co)
|
||||
rescue RsconsError => e
|
||||
co.close(false)
|
||||
raise e
|
||||
unless @_configured
|
||||
@_configured = true
|
||||
co = ConfigureOp.new(@script)
|
||||
begin
|
||||
@script.configure(co)
|
||||
rescue RsconsError => e
|
||||
co.close(false)
|
||||
raise e
|
||||
end
|
||||
Cache.instance["configuration_data"]["enabled_variants"] = @enabled_variants
|
||||
co.close(true)
|
||||
end
|
||||
Cache.instance["configuration_data"]["enabled_variants"] = @enabled_variants
|
||||
co.close(true)
|
||||
end
|
||||
|
||||
# Remove installed files.
|
||||
|
@ -1836,6 +1836,15 @@ EOF
|
||||
expect(result.status).to_not eq 0
|
||||
end
|
||||
|
||||
it "only runs the configure operation once" do
|
||||
test_dir "configure"
|
||||
|
||||
result = run_rscons(args: %w[-f configure_with_top_level_env.rb configure])
|
||||
expect(result.stderr).to eq ""
|
||||
expect(result.status).to eq 0
|
||||
expect(result.stdout).to_not match %r{Configuring project.*Configuring project}m
|
||||
end
|
||||
|
||||
it "automatically runs the configure task if the project is not yet configured in the given build directory" do
|
||||
test_dir "configure"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user