1 #!/usr/bin/env perl 2 # 3 4 use File::Copy; 5 use File::Path; 6 use Fcntl ':flock'; 7 use strict; 8 use warnings; 9 10 #open STDOUT, '>&STDERR'; 11 12 chdir "demos/http3"; 13 open(my $fh, '>>', './build.info') or die "Could not open build.info - $!"; 14 flock($fh, LOCK_EX) or die "Could not lock build.info - $!"; 15 16 if (-d "./nghttp3") { 17 rmtree("./nghttp3") or die "Cannot remove nghttp3: $!"; 18 } 19 system("git clone https://github.com/ngtcp2/nghttp3.git"); 20 21 chdir "nghttp3"; 22 mkdir "build"; 23 system("git submodule init ./lib/sfparse ./tests/munit"); 24 system("git submodule update"); 25 system("cmake -DENABLE_LIB_ONLY=1 -S . -B build"); 26 system("cmake --build build"); 27 28 my $libs="./build/lib/libnghttp*"; 29 30 for my $file (glob $libs) { 31 copy($file, ".."); 32 } 33 34 chdir "../../.."; 35 close($fh); 36 37 exit(0); 38