gen_nghttp3.pl 767 B

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