From: Graham Knop Date: Fri, 1 May 2020 15:48:32 +0000 (+0200) Subject: simplify dynamic prereq setting to only add Cpanel::JSON::XS if possible X-Git-Tag: v1.004001~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da4118c08cc349aafb5b6aa533003962b0939d95;p=p5sagit%2FJSON-MaybeXS.git simplify dynamic prereq setting to only add Cpanel::JSON::XS if possible Since we are always trying to add Cpanel::JSON::XS as a prereq, and the module prefers it if it is installed, there's no purpose to trying to upgrade JSON::XS. We can simplify the dynamic prereq handling to just add Cpanel::JSON::XS if XS compilation is available. --- diff --git a/Makefile.PL b/Makefile.PL index 3dcae79..d32e628 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -67,18 +67,8 @@ my %MM_ARGS = (); ## DYNAMIC PREREQS ########################################################### -if (! parse_args()->{PUREPERL_ONLY}) { - # we require Cpanel::JSON::XS whenever a compiler is available. - # (we also always recommend Cpanel::JSON::XS, just to make sure.) - $MM_ARGS{PREREQ_PM}{'Cpanel::JSON::XS'} = '2.3310' - if eval { require Cpanel::JSON::XS; 1 } - or can_compile_loadable_object(quiet => 1); - - # JSON::XS 3 changed its boolean handling - update it - # if JSON::XS is installed and < 3.0 - $MM_ARGS{PREREQ_PM}{'JSON::XS'} = '3.00' - if eval { require JSON::XS; 1 } - and not eval { JSON::XS->VERSION('3.0'); 1 }; +if (! parse_args()->{PUREPERL_ONLY} && can_compile_loadable_object(quiet => 1)) { + $MM_ARGS{PREREQ_PM}{'Cpanel::JSON::XS'} = '2.3310'; } use Text::ParseWords;