Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / VC8ProjectCreator.pm
blob3f9d06d872ddc223d6adb16e0cd9dfc77bc7249b
1 package VC8ProjectCreator;
3 # ************************************************************
4 # Description : A VC8 Project Creator
5 # Author : Johnny Willemsen
6 # Create Date : 4/21/2004
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use VC7ProjectCreator;
17 use vars qw(@ISA);
18 @ISA = qw(VC7ProjectCreator);
20 # ************************************************************
21 # Data Section
22 # ************************************************************
24 ## NOTE: We call the constant as a function to support Perl 5.6.
25 my %info = (Creator::cplusplus() => {'ext' => '.vcproj',
26 'dllexe' => 'vc8exe',
27 'libexe' => 'vc8libexe',
28 'dll' => 'vc8dll',
29 'lib' => 'vc8lib',
30 'template' => 'vc8',
32 Creator::csharp() => {'ext' => '.csproj',
33 'dllexe' => 'vc8csharp',
34 'libexe' => 'vc8csharp',
35 'dll' => 'vc8csharp',
36 'lib' => 'vc8csharp',
37 'template' => 'vc8csharp',
39 Creator::java() => {'ext' => '.vjsproj',
40 'dllexe' => 'vc8java',
41 'libexe' => 'vc8java',
42 'dll' => 'vc8java',
43 'lib' => 'vc8java',
44 'template' => 'vc8java',
46 Creator::vb() => {'ext' => '.vbproj',
47 'dllexe' => 'vc8vb',
48 'libexe' => 'vc8vb',
49 'dll' => 'vc8vb',
50 'lib' => 'vc8vb',
51 'template' => 'vc8vb',
55 my %config = ('vcversion' => '8.00');
57 # ************************************************************
58 # Subroutine Section
59 # ************************************************************
61 sub languageSupported {
62 return defined $info{$_[0]->get_language()};
66 sub webapp_supported {
67 #my $self = shift;
68 return 1;
72 sub require_dependencies {
73 ## With vc8, they fixed it such that static libraries that depend on
74 ## other static libraries will not be included into the target library
75 ## by default. Way to go Microsoft!
76 return 1;
79 sub post_file_creation {
80 my($self, $file) = @_;
82 ## VC8 stores information in a .user file that may conflict
83 ## with information stored in the project file. If we have
84 ## created a new project file, we will remove the corresponding
85 ## .user file to avoid strange conflicts.
86 unlink("$file.user");
87 return undef;
90 sub get_configurable {
91 #my($self, $name) = @_;
92 return $config{$_[1]};
95 sub get_info_hash {
96 my($self, $key) = @_;
98 ## If we have the setting in our information map, the use it.
99 return $info{$key} if (defined $info{$key});
101 ## Otherwise, see if our parent type can take care of it.
102 return $self->SUPER::get_info_hash($key);
105 sub translate_value {
106 my($self, $key, $val) = @_;
108 ## Microsoft uses AnyCPU in the project file, but uses Any CPU in the
109 ## solution file.
110 $val = 'Any CPU' if ($key eq 'platform' && $val eq 'AnyCPU');
112 return $self->SUPER::translate_value($key, $val);