Skip to content

Commit

Permalink
Makefile.PL: require ExtUtils::CppGuess and set the std expected
Browse files Browse the repository at this point in the history
zxing requires C++17 but prefers C++20, so try for 20 but
accept 17.
  • Loading branch information
tonycoz committed Sep 9, 2023
1 parent 0af4bc6 commit 829a129
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $opts{META_MERGE}{prereqs} =
requires =>
{
@Imager_req,
"ExtUtils::CppGuess" => 0,
"ExtUtils::CppGuess" => "0.22",
"ExtUtils::MakeMaker" => "6.46",
"ExtUtils::CppGuess" => 0,
},
Expand Down Expand Up @@ -124,9 +124,14 @@ DIE
tr/\n / /s for $cflags, $ldflags;

my $guess = ExtUtils::CppGuess->new;
# prefer C++20, but accept C++17
my $std = '';
unless (eval { $std = $guess->cpp_standard_flag("C++20") }) {
$std = $guess->cpp_standard_flag("C++17");
}
$guess->add_extra_compiler_flags
(
$cflags . " " . Imager::ExtUtils->includes
$cflags . " " . Imager::ExtUtils->includes . " $std"
);
$guess->add_extra_linker_flags
(
Expand Down

0 comments on commit 829a129

Please sign in to comment.