diff options
author | Adam Mitz <mitza@objectcomputing.com> | 2021-11-08 11:18:42 -0600 |
---|---|---|
committer | Adam Mitz <mitza@objectcomputing.com> | 2021-11-08 11:19:47 -0600 |
commit | bdb7c35e6d8ae3451123ed1694a58a744c48e957 (patch) | |
tree | 9a5e83c83c0f75e3d6f225fea31653c147858b03 /modules | |
parent | cdf4e7e044a258dbe9da7ee359f9ddf885d9c755 (diff) | |
download | MPC-bdb7c35e6d8ae3451123ed1694a58a744c48e957.tar.gz |
Generate Visual Studio 2022 projects and solutions
Diffstat (limited to 'modules')
-rw-r--r-- | modules/VS2022ProjectCreator.pm | 56 | ||||
-rw-r--r-- | modules/VS2022WorkspaceCreator.pm | 39 |
2 files changed, 95 insertions, 0 deletions
diff --git a/modules/VS2022ProjectCreator.pm b/modules/VS2022ProjectCreator.pm new file mode 100644 index 00000000..2f9ce191 --- /dev/null +++ b/modules/VS2022ProjectCreator.pm @@ -0,0 +1,56 @@ +package VS2022ProjectCreator; + +# ************************************************************ +# Description : vs2022 (Visual Studio 2022) Project Creator +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use VC12ProjectCreator; + +use vars qw(@ISA); +@ISA = qw(VC12ProjectCreator); + +## NOTE: We call the constant as a function to support Perl 5.6. +my %info = (Creator::cplusplus() => {'ext' => '.vcxproj', + 'dllexe' => 'vs2022exe', + 'libexe' => 'vs2022libexe', + 'dll' => 'vs2022dll', + 'lib' => 'vs2022lib', + 'template' => [ 'vc10', 'vc10filters' ], + }, + ); + +my %config = ('vcversion' => '16.00', + 'toolsversion' => '16.0', + ); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub get_info_hash { + my($self, $key) = @_; + + ## If we have the setting in our information map, then use it. + return $info{$key} if (defined $info{$key}); + + ## Otherwise, see if our parent type can take care of it. + return $self->SUPER::get_info_hash($key); +} + +sub get_configurable { + my($self, $name) = @_; + + ## If we have the setting in our config map, then use it. + return $config{$name} if (defined $config{$name}); + + ## Otherwise, see if our parent type can take care of it. + return $self->SUPER::get_configurable($name); +} + +1; diff --git a/modules/VS2022WorkspaceCreator.pm b/modules/VS2022WorkspaceCreator.pm new file mode 100644 index 00000000..39393912 --- /dev/null +++ b/modules/VS2022WorkspaceCreator.pm @@ -0,0 +1,39 @@ +package VS2022WorkspaceCreator; + +# ************************************************************ +# Description : vs2022 (Visual Studio 2022) Workspace Creator +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use VS2022ProjectCreator; +use VC12WorkspaceCreator; + +use vars qw(@ISA); +@ISA = qw(VC12WorkspaceCreator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub pre_workspace { + my($self, $fh) = @_; + my $crlf = $self->crlf(); + + print $fh '', $crlf, + 'Microsoft Visual Studio Solution File, Format Version 12.00', $crlf; + $self->print_workspace_comment($fh, + '# Visual Studio 17', $crlf, + '#', $crlf, + '# This file was generated by MPC. Any changes made directly to', $crlf, + '# this file will be lost the next time it is generated.', $crlf, + '#', $crlf, + '# MPC Command:', $crlf, + '# ', $self->create_command_line_string($0, @ARGV), $crlf); +} + +1; |