Only create (D)COM output files if there were COM objects in the IDL files.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 16 Dec 2008 15:37:54 +0000 (16:37 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 16 Dec 2008 15:37:54 +0000 (16:37 +0100)
pidl/lib/Parse/Pidl/Samba4/COM/Header.pm
pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm

index 996689b4b626431b4c340373598506e659236906..de7d4547a5b020cbb97f990c5f6ab7289a82c6b0 100644 (file)
@@ -127,6 +127,7 @@ sub Parse($$)
 {
        my ($idl,$ndr_header) = @_;
        my $res = "";
 {
        my ($idl,$ndr_header) = @_;
        my $res = "";
+       my $has_obj = 0;
 
        $res .= "#include \"librpc/gen_ndr/orpc.h\"\n" . 
                        "#include \"$ndr_header\"\n\n";
 
        $res .= "#include \"librpc/gen_ndr/orpc.h\"\n" . 
                        "#include \"$ndr_header\"\n\n";
@@ -135,6 +136,7 @@ sub Parse($$)
        {
                if ($_->{TYPE} eq "INTERFACE" && has_property($_, "object")) {
                        $res .="struct $_->{NAME};\n";
        {
                if ($_->{TYPE} eq "INTERFACE" && has_property($_, "object")) {
                        $res .="struct $_->{NAME};\n";
+                       $has_obj = 1;
                }
        }
 
                }
        }
 
@@ -142,14 +144,17 @@ sub Parse($$)
        {
                if ($_->{TYPE} eq "INTERFACE" && has_property($_, "object")) {
                        $res.=ParseInterface($_);
        {
                if ($_->{TYPE} eq "INTERFACE" && has_property($_, "object")) {
                        $res.=ParseInterface($_);
+                       $has_obj = 1;
                } 
 
                if ($_->{TYPE} eq "COCLASS") {
                        $res.=ParseCoClass($_);
                } 
 
                if ($_->{TYPE} eq "COCLASS") {
                        $res.=ParseCoClass($_);
+                       $has_obj = 1;
                }
        }
 
                }
        }
 
-       return $res;
+       return $res if ($has_obj);
+       return undef;
 }
 
 1;
 }
 
 1;
index ca9f37a0531fc69a64b77d2a727f7df55627f436..27e1e5d4243c323784fccfeac83224db23e01b2c 100644 (file)
@@ -201,6 +201,7 @@ sub Parse($$)
 {
        my ($pidl,$comh_filename) = @_;
        my $res = "";
 {
        my ($pidl,$comh_filename) = @_;
        my $res = "";
+       my $has_obj = 0;
 
        $res .= "#include \"includes.h\"\n" .
                        "#include \"lib/com/dcom/dcom.h\"\n" .
 
        $res .= "#include \"includes.h\"\n" .
                        "#include \"lib/com/dcom/dcom.h\"\n" .
@@ -213,9 +214,12 @@ sub Parse($$)
                next unless has_property($_, "object");
 
                $res .= ParseInterface($_);
                next unless has_property($_, "object");
 
                $res .= ParseInterface($_);
+
+               $has_obj = 1;
        }
 
        }
 
-       return $res;
+       return $res if ($has_obj);
+       return undef;
 }
 
 1;
 }
 
 1;