From c9cea6f2942eedcb3683097deabc7071c243fd98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Mon, 10 Aug 2009 17:44:09 +0200 Subject: [PATCH] winemaker: Parse libraries of vcproj-files. --- tools/winemaker | 60 ++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/tools/winemaker b/tools/winemaker index 79572c39ae5..060e20796d9 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; }