Avoid running configure operation twice - close #156

This commit is contained in:
Josh Holtrop 2022-03-11 21:17:07 -05:00
parent e3ea429253
commit b932380b3b
3 changed files with 25 additions and 8 deletions

View File

@ -0,0 +1,5 @@
configure do
check_c_compiler
end
env do |env|
end

View File

@ -207,6 +207,8 @@ module Rscons
#
# @return [void]
def configure
unless @_configured
@_configured = true
co = ConfigureOp.new(@script)
begin
@script.configure(co)
@ -217,6 +219,7 @@ module Rscons
Cache.instance["configuration_data"]["enabled_variants"] = @enabled_variants
co.close(true)
end
end
# Remove installed files.
#

View File

@ -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"