winemaker: parse libraries of vcproj-files

André Hentschel nerv at dawncrow.de
Mon Aug 10 10:44:09 CDT 2009


---
 tools/winemaker |   60 ++++++++++++++++++++++++++++++++----------------------
 1 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/tools/winemaker b/tools/winemaker
index 79572c3..060e207 100755
--- a/tools/winemaker
+++ b/tools/winemaker
@@ -20,7 +20,7 @@ use strict;
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 #
 
-my $version="0.7.2";
+my $version="0.7.3";
 
 use Cwd;
 use File::Basename;
@@ -726,11 +726,9 @@ sub source_scan_project_file($$$)
                 @prj_target_options=split(" /", $prj_target_ldflags);
                 $prj_target_ldflags="";
                 $prj_target_libs=$prj_target_options[0];
-                #print "\n$prj_target_libs bevor\n";
                 $prj_target_libs=~s/\\/\//g;
                 $prj_target_libs=~s/\.lib//g;
                 $prj_target_libs=~s/\s+/ -l/g;
-                #print "\n$prj_target_libs after\n";
                 shift (@prj_target_options);
                 foreach ( @prj_target_options ) {
                     if ($_ eq "") {
@@ -908,34 +906,46 @@ sub source_scan_project_file($$$)
 
         foreach my $vc_configuration_tools ($vc_configuration->findnodes('Tool')) {
             my @find_tool = $vc_configuration_tools->attributes;
-            if ($find_tool[0]->getValue ne "VCCLCompilerTool") {next;}
-            foreach my $vc_configuration_tool ($vc_configuration_tools->attributes) {
-                if ($vc_configuration_tool->getName eq "Optimization") {$prj_target_cflags.="-O".$vc_configuration_tool->getValue." ";}
-                if ($vc_configuration_tool->getName eq "WarningLevel") {
-                    if ($vc_configuration_tool->getValue==0) {
-                        $prj_target_cflags.="-w ";
-                    } elsif ($vc_configuration_tool->getValue<4) {
-                        $prj_target_cflags.="-W ";
-                    } elsif ($vc_configuration_tool->getValue==4) {
-                        $prj_target_cflags.="-Wall ";
-                    } elsif ($vc_configuration_tool->getValue eq "X") {
-                        $prj_target_cflags.="-Werror ";
+            if ($find_tool[0]->getValue eq "VCCLCompilerTool") {
+                foreach my $vc_compiler_tool ($vc_configuration_tools->attributes) {
+                    if ($vc_compiler_tool->getName eq "Optimization") {$prj_target_cflags.="-O".$vc_compiler_tool->getValue." ";}
+                    if ($vc_compiler_tool->getName eq "WarningLevel") {
+                        if ($vc_compiler_tool->getValue==0) {
+                            $prj_target_cflags.="-w ";
+                        } elsif ($vc_compiler_tool->getValue<4) {
+                            $prj_target_cflags.="-W ";
+                        } elsif ($vc_compiler_tool->getValue==4) {
+                            $prj_target_cflags.="-Wall ";
+                        } elsif ($vc_compiler_tool->getValue eq "X") {
+                            $prj_target_cflags.="-Werror ";
+                        }
+                    }
+                    if ($vc_compiler_tool->getName eq "PreprocessorDefinitions") {
+                        $configt=$vc_compiler_tool->getValue;
+                        $configt=~s/;/ -D/g;
+                        $prj_target_cflags.="-D".$configt." ";
+                    }
+                    if ($vc_compiler_tool->getName eq "AdditionalIncludeDirectories") {
+                        $configt=$vc_compiler_tool->getValue;
+                        $configt=~s/\\/\//g;
+                        $configt=~s/;/ -I/g;
+                        push @{@$project_settings[$T_INCLUDE_PATH]},"-I".$configt;
                     }
                 }
-                if ($vc_configuration_tool->getName eq "PreprocessorDefinitions") {
-                    $configt=$vc_configuration_tool->getValue;
-                    $configt=~s/;/ -D/g;
-                    $prj_target_cflags.="-D".$configt." ";
-                }
-                if ($vc_configuration_tool->getName eq "AdditionalIncludeDirectories") {
-                    $configt=$vc_configuration_tool->getValue;
-                    $configt=~s/\\/\//g;
-                    $configt=~s/;/ -I/g;
-                    push @{@$project_settings[$T_INCLUDE_PATH]},"-I".$configt;
+            }
+            if ($find_tool[0]->getValue eq "VCLinkerTool") {
+                foreach my $vc_linker_tool ($vc_configuration_tools->attributes) {
+                    if ($vc_linker_tool->getName eq "AdditionalDependencies") {
+                        $prj_target_libs=" ".$vc_linker_tool->getValue;
+                        $prj_target_libs=~s/\\/\//g;
+                        $prj_target_libs=~s/\.lib//g;
+                        $prj_target_libs=~s/\s+/ -l/g;
+                    }
                 }
             }
         }
 
+        push @{@$project_settings[$T_LIBRARIES]},$prj_target_libs;
         push @{@$project_settings[$T_CEXTRA]},$prj_target_cflags;
         push @{@$project_settings[$T_CXXEXTRA]},$prj_target_cflags;
     }
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list