lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [2/6] git commit: refs/heads/master - Always compile as C++ with MSVC
Date Mon, 21 Jul 2014 16:51:51 GMT
Always compile as C++ with MSVC

Although the generated XS is C89-compliant now, 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.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/016d9db9
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/016d9db9
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/016d9db9

Branch: refs/heads/master
Commit: 016d9db9983e1d8dfe700792b7a3b01a12b6b025
Parents: 2bc30cd
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Jul 21 12:29:52 2014 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Jul 21 18:46:03 2014 +0200

----------------------------------------------------------------------
 perl/buildlib/Lucy/Build.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/016d9db9/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index 9eae2ae..0e5a3d5 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -51,6 +51,17 @@ else {
 sub new {
     my $self = shift->SUPER::new( recursive_test_files => 1, @_ );
 
+    # 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_VALGRIND} ) {
         my $optimize = $self->config('optimize') || '';
         $optimize =~ s/\-O\d+/-O1/g;


Mime
View raw message