Repository: lucy Updated Branches: refs/heads/master 470bb27de -> 8a37f575d
Fix Lucy::Util::Debug Perl module It wasn't enabled when setting the LUCY_DEBUG environment variable. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/a876a98d Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/a876a98d Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/a876a98d Branch: refs/heads/master Commit: a876a98dc003f6e33956491118ce34429b55a5c0 Parents: 470bb27 Author: Nick Wellnhofer <[email protected]> Authored: Sat Dec 24 14:07:31 2016 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Sat Dec 24 14:38:47 2016 +0100 ---------------------------------------------------------------------- perl/buildlib/Lucy/Build.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/a876a98d/perl/buildlib/Lucy/Build.pm ---------------------------------------------------------------------- diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm index 50a4ba5..747c45f 100644 --- a/perl/buildlib/Lucy/Build.pm +++ b/perl/buildlib/Lucy/Build.pm @@ -45,17 +45,25 @@ else { sub new { my $self = shift->SUPER::new( recursive_test_files => 1, @_ ); + # These compiler flags are only used to compile Perl-specific files + # with ExtUtils::CBuilder. + my $extra_cflags = $self->extra_compiler_flags; + # Fix for MSVC: Although the generated XS should be C89-compliant, it # must be compiled in C++ mode like the rest of the code due to a # mismatch between the sizes of the C++ bool type and the emulated bool # type. (The XS code is compiled with Module::Build's extra compiler # flags, not the Clownfish cflags.) if ($Config{cc} =~ /^cl\b/) { - my $extra_cflags = $self->extra_compiler_flags; push @$extra_cflags, '/TP'; - $self->extra_compiler_flags(@$extra_cflags); } + if ( $ENV{LUCY_DEBUG} ) { + push @$extra_cflags, '-DLUCY_DEBUG'; + } + + $self->extra_compiler_flags(@$extra_cflags); + if ( $ENV{LUCY_VALGRIND} ) { my $optimize = $self->config('optimize') || ''; $optimize =~ s/\-O\d+/-O1/g;
