From 93d911a09eb1b9600083da670ea6c99231c7f18a Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Thu, 11 Jun 2026 20:07:37 +0200 Subject: [PATCH] Hide allocator build options when building native --- scripts/build.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/build.pl b/scripts/build.pl index b074386..6b522d5 100755 --- a/scripts/build.pl +++ b/scripts/build.pl @@ -29,7 +29,9 @@ sub compile { " WAMR_USE_LINEAR_POOL_IN_TEXT=$ENV{WAMR_USE_LINEAR_POOL_IN_TEXT}", " compile.pl $module $target $mode"; - system( "perl $compile_pl $module $target $mode > $local_root/build.log 2>&1" ) == 0 + system( + "perl $compile_pl $module $target $mode > $local_root/build.log 2>&1") + == 0 or die "Build failed\n"; sleep(1); } @@ -137,7 +139,9 @@ my @global_heap_variants = ( "Let the linker decide where global_heap is located" ); my $selected_global_heap_variant = $global_heap_variants[1]; -if ( $selected_allocator_variant eq $allocator_variants[0] ) { +if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes + and $selected_allocator_variant eq $allocator_variants[0] ) +{ ($selected_global_heap_variant) = TUI::select_from_list( "Select WAMR Global Heap Variant", 0, @global_heap_variants ); @@ -157,7 +161,9 @@ my @runtime_pool_variants = ( "Let the linker decide where runtime_pool is located" ); my $selected_runtime_pool_variant = $runtime_pool_variants[1]; -if ( $selected_allocator_variant eq $allocator_variants[1] ) { +if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes + and $selected_allocator_variant eq $allocator_variants[1] ) +{ ($selected_runtime_pool_variant) = TUI::select_from_list( "Select WAMR Runtime Pool Variant", 0, @runtime_pool_variants ); @@ -178,7 +184,9 @@ my @linear_pool_variants = ( "Let the linker decide where linear_pool is located" ); my $selected_linear_pool_variant = $linear_pool_variants[1]; -if ( $selected_allocator_variant eq $allocator_variants[1] ) { +if ( grep { $_ eq "aot" or $_ eq "interp" } @selected_modes + and $selected_allocator_variant eq $allocator_variants[1] ) +{ ($selected_linear_pool_variant) = TUI::select_from_list( "Select WAMR Linear Pool Variant", 0, @linear_pool_variants );