diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2010-11-12 12:40:22 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2010-11-12 12:40:22 +0000 |
commit | 8edf6d76d4df2ee4327106abcd3cf91c82998143 (patch) | |
tree | 8fc3d0edafa91e182d1198ab02e507325d25e6c0 | |
parent | 7bfc896c33313d0210ef67e48bf65755a1df05cd (diff) | |
download | MPC-8edf6d76d4df2ee4327106abcd3cf91c82998143.tar.gz |
ChangeLogTag: Fri Nov 12 12:39:55 UTC 2010 Chad Elliott <elliott_c@ociweb.com>
36 files changed, 448 insertions, 82 deletions
@@ -1,8 +1,71 @@ +Fri Nov 12 12:39:55 UTC 2010 Chad Elliott <elliott_c@ociweb.com> + + * config/mfc.mpb: + * config/winapp.mpb: + + Factored out portions that instruct a Windows project to be a + GUI. + + * config/wxadvanced.mpb: + * config/wxaui.mpb: + * config/wxbase.mpb: + * config/wxcore.mpb: + * config/wxdbgrid.mpb: + * config/wxgl.mpb: + * config/wxhtml.mpb: + * config/wxmedia.mpb: + * config/wxnet.mpb: + * config/wxodbc.mpb: + * config/wxpropertygrid.mpb: + * config/wxqa.mpb: + * config/wxribbon.mpb: + * config/wxrichtext.mpb: + * config/wxstc.mpb: + * config/wxxml.mpb: + * config/wxxrc.mpb: + + Added base projects for the various wxWindows. + + * config/wxmake.mpb: + * config/wxmsvs.mpb: + + These base projects are project type specific and designed to work + with wxWindows. The comments inside the files describe their use. + + * modules/BCB2007WorkspaceCreator.pm: + * modules/BMakeWorkspaceCreator.pm: + * modules/CDT6ProjectCreator.pm: + * modules/CDT6WorkspaceCreator.pm: + * modules/HTMLWorkspaceCreator.pm: + * modules/NMakeWorkspaceCreator.pm: + * modules/ProjectCreator.pm: + * modules/VC6WorkspaceCreator.pm: + * modules/VC7WorkspaceCreator.pm: + * modules/VC8WorkspaceCreator.pm: + * modules/WB26WorkspaceCreator.pm: + * modules/WixWorkspaceCreator.pm: + * modules/WorkspaceCreator.pm: + + Use constants to access the 'project_info' arrays instead of magic + numbers. Also, a method from ProjectCreator can be used to pull + specific values out of the 'project_info' instead of directly + accessing the array. + + ProjectCreator also has a bug fix relating to the use of + Modify_Custom in conjunction with a built-in component type (e.g., + Source_Files). If that is used, files that are generated from + other custom definitions were not getting added to the project. + + * templates/makedll.mpt: + + Changed the link flags to use both -shared and -dynamic. Earlier + versions of gcc used -dynamic and later versions use -shared. + Fri Nov 12 08:49:38 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> * modules/TemplateParser.pm: Committed fix from Adam Mitz that fixed problems with dds4ccm and - cdt6/cdt7 + cdt6/cdt7. Wed Nov 10 02:28:28 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu> diff --git a/config/mfc.mpb b/config/mfc.mpb index 145832cd..f35a6cb8 100644 --- a/config/mfc.mpb +++ b/config/mfc.mpb @@ -1,17 +1,10 @@ // -*- MPC -*- // $Id$ -project { +project: winapp { requires += mfc macros += _AFXDLL - specific(em3, nmake, vc6) { - subsystem = windows - } else { - subsystem = 2 - } - specific(vc10) { - subsystem = Windows - } + specific { use_mfc = 2 unicode_mfc_entry = wWinMainCRTStartup diff --git a/config/winapp.mpb b/config/winapp.mpb new file mode 100644 index 00000000..cbb0c7e5 --- /dev/null +++ b/config/winapp.mpb @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + +project { + specific(em3, nmake, vc6) { + subsystem = windows + } else { + subsystem = 2 + } + specific(vc10) { + subsystem = Windows + } +} diff --git a/config/wxadvanced.mpb b/config/wxadvanced.mpb new file mode 100644 index 00000000..be213575 --- /dev/null +++ b/config/wxadvanced.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_adv + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_adv + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_adv$(WX_VERSION) + } +} diff --git a/config/wxaui.mpb b/config/wxaui.mpb new file mode 100644 index 00000000..73cd0abe --- /dev/null +++ b/config/wxaui.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxadvanced, wxhtml, wxxml { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_aui + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_aui + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_aui$(WX_VERSION) + } +} diff --git a/config/wxbase.mpb b/config/wxbase.mpb new file mode 100644 index 00000000..f4b10019 --- /dev/null +++ b/config/wxbase.mpb @@ -0,0 +1,35 @@ +// $Id$ +project { + // wxWindows specific variables used by this and other wxWindows related + // base projects. You must always set WXWINDOWS_ROOT to the full path of + // the installation of wxWindows. + // + // If you have a project that inherits from this project, you can do one + // of two things to get the following variable settings: + // 1) You can set them as environment variables before you begin building. + // 2) You can have your project also inherit from one of the base projects + // to automatically set them. Use 'wxmake' for use with the 'make' + // project type. Or use 'wxmsvs' for use with Visual Studio related + // project types (e.g., vc71, vc8, vc9, vc10, etc.). You may need to + // edit wxmsvs.mpb to correspond to the values of your version of + // wxWindows. + // + // WX_PORT - e.g., gtk2, msw + // WX_PORT_MACRO - e.g., __WXGTK__ + // WX_VERSION - e.g., -2.9, 29 + // WX_UNICODE - e.g., u + // WX_BUILD_CONFIG - e.g., gtk2-unicode + + requires += wxwindows + includes += $(WXWINDOWS_ROOT)/include/wx$(WX_VERSION) \ + $(WXWINDOWS_ROOT)/lib/wx/include/$(WX_BUILD_CONFIG)$(WX_VERSION) + macros += WXUSINGDLL $(WX_PORT_MACRO) + libpaths += $(WXWINDOWS_ROOT)/lib + + specific(prop:windows) { + Debug::lit_libs += wxbase$(WX_VERSION)$(WX_UNICODE)d + Release::lit_libs += wxbase$(WX_VERSION)$(WX_UNICODE) + } else { + lit_libs += wx_base$(WX_UNICODE)$(WX_VERSION) + } +} diff --git a/config/wxcore.mpb b/config/wxcore.mpb new file mode 100644 index 00000000..2e200ae9 --- /dev/null +++ b/config/wxcore.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxbase, winapp { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_core + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_core + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_core$(WX_VERSION) + } +} diff --git a/config/wxdbgrid.mpb b/config/wxdbgrid.mpb new file mode 100644 index 00000000..d8986be9 --- /dev/null +++ b/config/wxdbgrid.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxodbc, wxadvanced { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_dbgrid + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_dbgrid + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_dbgrid$(WX_VERSION) + } +} diff --git a/config/wxgl.mpb b/config/wxgl.mpb new file mode 100644 index 00000000..bcfb487c --- /dev/null +++ b/config/wxgl.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_gl + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_gl + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_gl$(WX_VERSION) + } +} diff --git a/config/wxhtml.mpb b/config/wxhtml.mpb new file mode 100644 index 00000000..a4a3fa93 --- /dev/null +++ b/config/wxhtml.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_html + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_html + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_html$(WX_VERSION) + } +} diff --git a/config/wxmake.mpb b/config/wxmake.mpb new file mode 100644 index 00000000..3f1e961b --- /dev/null +++ b/config/wxmake.mpb @@ -0,0 +1,11 @@ +// $Id$ +project { + verbatim(make, macros) { + WX_PORT = $(shell $(WXWINDOWS_ROOT)/bin/wx-config --query-toolkit) + WX_PORT_MACRO = $(shell $(WXWINDOWS_ROOT)/bin/wx-config --cflags | sed 's/.*\-D__/__/; s/__ .*/__/') + WX_VERSION = -$(shell $(WXWINDOWS_ROOT)/bin/wx-config --version | sed 's/^\\([0-9]*\\)\\.\\([0-9]*\\)\\.[0-9]*/\\1.\\2/') + WX_CHARTYPE = $(shell $(WXWINDOWS_ROOT)/bin/wx-config --query-chartype) + WX_UNICODE = $(shell echo $(WX_CHARTYPE) | sed 's!unicode!u!;s!ansi!!') + WX_BUILD_CONFIG = $(WX_PORT)-$(WX_CHARTYPE) + } +} diff --git a/config/wxmedia.mpb b/config/wxmedia.mpb new file mode 100644 index 00000000..f8809908 --- /dev/null +++ b/config/wxmedia.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_media + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_media + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)media$(WX_VERSION) + } +} diff --git a/config/wxmsvs.mpb b/config/wxmsvs.mpb new file mode 100644 index 00000000..5ea539d3 --- /dev/null +++ b/config/wxmsvs.mpb @@ -0,0 +1,22 @@ +// $Id$ +project { + // These settings are specific to wxWindows 2.9.X on Visual Studio. + // If you are using a different version of wxWindows, feel free to change + // the version number to match your version. + + expand(WX_PORT) { + msw + } + expand(WX_PORT_MACRO) { + __WXMSW__ + } + expand(WX_VERSION) { + 29 + } + expand(WX_UNICODE) { + u + } + expand(WX_BUILD_CONFIG) { + msw-unicode + } +} diff --git a/config/wxnet.mpb b/config/wxnet.mpb new file mode 100644 index 00000000..27d7f0cd --- /dev/null +++ b/config/wxnet.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxbase { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)d_net + Release::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)_net + } else { + lit_libs += wx_base$(WX_UNICODE)_net$(WX_VERSION) + } +} diff --git a/config/wxodbc.mpb b/config/wxodbc.mpb new file mode 100644 index 00000000..edcb985d --- /dev/null +++ b/config/wxodbc.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxbase { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)d_odbc + Release::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)_odbc + } else { + lit_libs += wx_base$(WX_UNICODE)_odbc$(WX_VERSION) + } +} diff --git a/config/wxpropertygrid.mpb b/config/wxpropertygrid.mpb new file mode 100644 index 00000000..68a8d830 --- /dev/null +++ b/config/wxpropertygrid.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxadvanced { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_propgrid + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_propgrid + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_propgrid$(WX_VERSION) + } +} diff --git a/config/wxqa.mpb b/config/wxqa.mpb new file mode 100644 index 00000000..623ee40b --- /dev/null +++ b/config/wxqa.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore, wxxml { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_qa + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_qa + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_qa$(WX_VERSION) + } +} diff --git a/config/wxribbon.mpb b/config/wxribbon.mpb new file mode 100644 index 00000000..61bd1623 --- /dev/null +++ b/config/wxribbon.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxadvanced, wxhtml, wxxml { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_ribbon + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_ribbon + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_ribbon$(WX_VERSION) + } +} diff --git a/config/wxrichtext.mpb b/config/wxrichtext.mpb new file mode 100644 index 00000000..c448baa3 --- /dev/null +++ b/config/wxrichtext.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxadvanced, wxhtml, wxxml { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_richtext + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_richtext + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_richtext$(WX_VERSION) + } +} diff --git a/config/wxstc.mpb b/config/wxstc.mpb new file mode 100644 index 00000000..63c853da --- /dev/null +++ b/config/wxstc.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxcore { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_stc + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_stc + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_stc$(WX_VERSION) + } +} diff --git a/config/wxxml.mpb b/config/wxxml.mpb new file mode 100644 index 00000000..2a03dbd0 --- /dev/null +++ b/config/wxxml.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxbase { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)d_xml + Release::lit_libs += wx$(WX_VERSION)$(WX_UNICODE)_xml + } else { + lit_libs += wx_base$(WX_UNICODE)_xml$(WX_VERSION) + } +} diff --git a/config/wxxrc.mpb b/config/wxxrc.mpb new file mode 100644 index 00000000..3c0b4d1c --- /dev/null +++ b/config/wxxrc.mpb @@ -0,0 +1,9 @@ +// $Id$ +project: wxadvanced, wxhtml, wxxml { + specific(prop:windows) { + Debug::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)d_xrc + Release::lit_libs += wx$(WX_PORT)$(WX_VERSION)$(WX_UNICODE)_xrc + } else { + lit_libs += wx_$(WX_PORT)$(WX_UNICODE)_xrc$(WX_VERSION) + } +} diff --git a/modules/BCB2007WorkspaceCreator.pm b/modules/BCB2007WorkspaceCreator.pm index 582e8c44..b751988f 100644 --- a/modules/BCB2007WorkspaceCreator.pm +++ b/modules/BCB2007WorkspaceCreator.pm @@ -79,7 +79,7 @@ sub write_comps { ## Print the project targets foreach my $project (@projects) { - my $name = $$project_info{$project}->[0]; + my $name = $$project_info{$project}->[ProjectCreator::PROJECT_NAME]; print $fh ' <Target Name="', $name, '">', $crlf, ' <MSBuild Projects="', $self->mpc_basename($project), '" Targets="" />', $crlf, ' </Target>', $crlf, @@ -95,7 +95,7 @@ sub write_comps { print $fh ' <Target Name="Build">', $crlf, ' <CallTarget Targets="'; foreach my $project (@projects) { - print $fh $$project_info{$project}->[0], ';'; + print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME], ';'; } ## Print the target make order @@ -104,7 +104,8 @@ sub write_comps { ' <Target Name="Make">', $crlf, ' <CallTarget Targets="'; foreach my $project (@projects) { - print $fh $$project_info{$project}->[0], ':Make;'; + print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME], + ':Make;'; } ## Print the target clean order @@ -113,7 +114,8 @@ sub write_comps { ' <Target Name="Clean">', $crlf, ' <CallTarget Targets="'; foreach my $project (@projects) { - print $fh $$project_info{$project}->[0], ':Clean;'; + print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME], + ':Clean;'; } print $fh '" />', $crlf, ' </Target>', $crlf, diff --git a/modules/BMakeWorkspaceCreator.pm b/modules/BMakeWorkspaceCreator.pm index 14985cc3..de3f05f1 100644 --- a/modules/BMakeWorkspaceCreator.pm +++ b/modules/BMakeWorkspaceCreator.pm @@ -88,7 +88,7 @@ sub write_comps { ## Translate each project name my %trans; foreach my $project (@list) { - $trans{$project} = $$pjs{$project}->[0]; + $trans{$project} = $$pjs{$project}->[ProjectCreator::PROJECT_NAME]; } ## Send all the information to our base class method diff --git a/modules/CDT6ProjectCreator.pm b/modules/CDT6ProjectCreator.pm index a2832e0f..77eaece8 100644 --- a/modules/CDT6ProjectCreator.pm +++ b/modules/CDT6ProjectCreator.pm @@ -71,7 +71,7 @@ sub fill_value { } elsif ($name eq 'nocross') { # return the value of the 'nocross' element from the project_info array - return $self->get_project_info()->[5]; + return $self->get_project_info()->[ProjectCreator::NO_CROSS_COMPILE]; } return $self->get_configurable($name); diff --git a/modules/CDT6WorkspaceCreator.pm b/modules/CDT6WorkspaceCreator.pm index 33642190..5e577dfc 100644 --- a/modules/CDT6WorkspaceCreator.pm +++ b/modules/CDT6WorkspaceCreator.pm @@ -71,8 +71,7 @@ sub write_comps { $self->{'seen_deps'} = {}; foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { - my($pname, $rawdeps, $guid, $language, $custom_only, $nocross, $managed, $make_group, @cfgs) = @{$$info{$project}}; - print $fh "$pname ", + print $fh $$info{$project}->[ProjectCreator::PROJECT_NAME], ' ', Cwd::abs_path($self->mpc_dirname($project)), '/.project', $crlf; $self->add_dependencies($creator, $project); } diff --git a/modules/HTMLWorkspaceCreator.pm b/modules/HTMLWorkspaceCreator.pm index de4c727b..16453428 100644 --- a/modules/HTMLWorkspaceCreator.pm +++ b/modules/HTMLWorkspaceCreator.pm @@ -60,20 +60,20 @@ sub write_comps { my $crlf = $self->crlf(); ## Start the table for all of the projects - print $fh "<table style=\"table-layout:fixed\" width=\"400\" " . - "summary=\"MPC Projects\">$crlf" . - "<col style=\"background-color: darkcyan;\">$crlf" . - "<thead>$crlf" . - "<tr><td>Projects In Build Order</td></tr>$crlf" . - "</thead>$crlf" . + print $fh "<table style=\"table-layout:fixed\" width=\"400\" ", + "summary=\"MPC Projects\">$crlf", + "<col style=\"background-color: darkcyan;\">$crlf", + "<thead>$crlf", + "<tr><td>Projects In Build Order</td></tr>$crlf", + "</thead>$crlf", "<tbody>$crlf"; ## Sort the projects in build order instead of alphabetical order my $project_info = $self->get_project_info(); foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { - print $fh "<tr><td>" . - "<a href='$project'>$$project_info{$project}->[0]</a>" . - "</td></tr>$crlf"; + print $fh "<tr><td><a href='$project'>", + $$project_info{$project}->[ProjectCreator::PROJECT_NAME], + "</a></td></tr>$crlf"; } ## End the table diff --git a/modules/NMakeWorkspaceCreator.pm b/modules/NMakeWorkspaceCreator.pm index bbe074ac..ad649d54 100644 --- a/modules/NMakeWorkspaceCreator.pm +++ b/modules/NMakeWorkspaceCreator.pm @@ -63,7 +63,7 @@ sub write_project_targets { sub write_comps { - my($self, $fh) = @_; + my($self, $fh, $gen) = @_; my %targnum; my $pjs = $self->get_project_info(); my @list = $self->number_target_deps($self->get_projects(), $pjs, @@ -75,8 +75,8 @@ sub write_comps { ## configuration (if available). It just so happens that Debug comes ## before Release so sorting the configurations works in our favor. foreach my $project (keys %$pjs) { - my($name, $deps, $pguid, $lang, $custom_only, $nocross, $managed, $make_group, @cfgs) = @{$pjs->{$project}}; - @cfgs = sort @cfgs; + my @cfgs = sort $gen->access_pi_values($pjs, $project, + ProjectCreator::CONFIGURATIONS); if (defined $cfgs[0]) { $default = $cfgs[0]; diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 113f829d..2681fefa 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -161,6 +161,24 @@ my $tikey = '/ti/'; ## Matches with generic_outputext my $generic_key = 'generic_files'; +## These constants are used with the "project info" and +## must match the order that is defined by the call order +## of ProjectCreator::update_project_info(). This is called +## order is determined by the TemplateParser. +## +## NOTE: If you are going to add a new constant, you must make it the +## numeric avlue of the CONFIGURATIONS constant and increment +## the existing CONFIGURATIONS value. +use constant PROJECT_NAME => 0; +use constant DEPENDENCIES => 1; +use constant PROJECT_GUID => 2; +use constant LANGUAGE => 3; +use constant CUSTOM_ONLY => 4; +use constant NO_CROSS_COMPILE => 5; +use constant MANAGED_PROJECT => 6; +use constant MAKE_GROUP => 7; +use constant CONFIGURATIONS => 8; + # ************************************************************ # C++ Specific Component Settings # ************************************************************ @@ -2410,7 +2428,14 @@ sub generated_filenames { last if ($good); } } - return () if (!$good); + + ## If we were not able to find the right file type, then we can get + ## out early. However, if the type for which we are generating + ## ($tag) is a built-in type, we need to continue on as there is a + ## possibility that the input type ($type) will generate files for + ## the generating type. + return () if (!$good && + !defined $language{$self->get_language()}->[0]->{$tag}); } my @pearr = $self->get_pre_keyword_array('pre_extension', @@ -5134,6 +5159,27 @@ sub update_project_info { } +sub access_pi_values { + my $self = shift; + my $pjs = shift; + my $proj = shift; + + ## This will use the keys left in @_ as indices into the project + ## info array. But, if the user wants configurations, we need to + ## pop that key off and access it along with all the rest of the + ## elements in the array. The CONFIGURATIONS key should always + ## be last if it's included at all. If it's not, the caller will + ## only receive the first configuration instead of all of them. + if ($_[$#_] == CONFIGURATIONS) { + my $last = scalar(@{$$pjs{$proj}}) - 1; + pop(@_); + return @{$$pjs{$proj}}[@_], @{$$pjs{$proj}}[CONFIGURATIONS..$last]; + } + + return @{$$pjs{$proj}}[@_]; +} + + sub adjust_value { my($self, $names, $value, $tp) = @_; my $atemp = $self->get_addtemp(); diff --git a/modules/VC6WorkspaceCreator.pm b/modules/VC6WorkspaceCreator.pm index e10d5659..4e2f55d9 100644 --- a/modules/VC6WorkspaceCreator.pm +++ b/modules/VC6WorkspaceCreator.pm @@ -69,7 +69,8 @@ sub write_comps { ## Add the project name and project file information print $fh "###############################################################################$crlf$crlf", - "Project: \"$$pjs{$project}->[0]\"=", $self->slash_to_backslash($project), + 'Project: "', $$pjs{$project}->[ProjectCreator::PROJECT_NAME], + '"=', $self->slash_to_backslash($project), " - Package Owner=<4>$crlf$crlf", "Package=<5>${crlf}{{{$crlf}}}$crlf$crlf", "Package=<4>${crlf}{{{$crlf"; diff --git a/modules/VC7WorkspaceCreator.pm b/modules/VC7WorkspaceCreator.pm index 812363ad..789ea427 100644 --- a/modules/VC7WorkspaceCreator.pm +++ b/modules/VC7WorkspaceCreator.pm @@ -102,14 +102,19 @@ sub print_dependencies { ## we must have some way to map plain project names to guids. my %name_to_guid_map; foreach my $project (@$list) { - my($name, $deps, $guid) = @{$$pjs{$project}}; + my($name, $guid) = $gen->access_pi_values($pjs, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::PROJECT_GUID); $name_to_guid_map{$name} = $guid; } ## Project Dependencies print $fh "\tGlobalSection(ProjectDependencies) = postSolution$crlf"; foreach my $project (@$list) { - my($name, $rawdeps, $project_guid) = @{$$pjs{$project}}; + my($name, $project_guid) = $gen->access_pi_values( + $pjs, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::PROJECT_GUID); my $deps = $self->get_validated_ordering($project); if (defined $$deps[0]) { my $i = 0; @@ -137,13 +142,20 @@ sub write_comps { ## we must have some way to map plain project names to guids. my %name_to_guid_map; foreach my $project (@list) { - my($name, $deps, $guid) = @{$$pjs{$project}}; + my($name, $guid) = $gen->access_pi_values($pjs, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::PROJECT_GUID); $name_to_guid_map{$name} = $guid; } ## Project Information foreach my $project (@list) { - my($pname, $rawdeps, $guid, $language, $custom_only, $nocross, $managed, $make_group, @cfgs) = @{$$pjs{$project}}; + my($pname, $guid, $language, @cfgs) = + $gen->access_pi_values($pjs, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::PROJECT_GUID, + ProjectCreator::LANGUAGE, + ProjectCreator::CONFIGURATIONS); my $pguid = $guids{$language}; my $deps = $self->get_validated_ordering($project); my($name, $proj) = $self->adjust_names($pname, $project, $language); @@ -162,7 +174,8 @@ sub write_comps { ") = preSolution$crlf"; my %configs; foreach my $project (@list) { - my($name, $deps, $pguid, $lang, $custom_only, $nocross, $managed, $make_group, @cfgs) = @{$$pjs{$project}}; + my @cfgs = $gen->access_pi_values($pjs, $project, + ProjectCreator::CONFIGURATIONS); foreach my $cfg (@cfgs) { $configs{$self->get_short_config_name($cfg)} = $cfg; } @@ -189,18 +202,25 @@ sub write_comps { ## Go through each project and print out the settings per GUID foreach my $project (@list) { - my($name, $deps, $pguid, $lang, $custom_only, $nocross, $managed, $make_group, @cfgs) = @{$$pjs{$project}}; + my($pguid, $custom_only, $nocross, @cfgs) = + $gen->access_pi_values($pjs, $project, + ProjectCreator::PROJECT_GUID, + ProjectCreator::CUSTOM_ONLY, + ProjectCreator::NO_CROSS_COMPILE, + ProjectCreator::CONFIGURATIONS); my %all_configs = %configs; foreach my $cfg (sort @cfgs) { my $c = $self->get_short_config_name($cfg); - my $deployable = !$nocross; - my $buildable = $deployable; + my $deployable = !$nocross && !$custom_only; + my $buildable = !$nocross; + + ## I don't like this hard-coded configuration information. + ## CAE 11/4/2010 if (index($cfg, 'Win32') >= 0 || index($cfg, 'x64') >= 0) { - $deployable = 0; + $deployable = undef; $buildable = 1; - } elsif ($custom_only) { - $deployable = 0; } + if (defined $anycpu) { ## There is a non-C++ project; there is no need to explicitly ## enable building of the configurations for this project. So, we @@ -210,8 +230,8 @@ sub write_comps { } else { print $fh "\t\t{$pguid}.$c.ActiveCfg = $cfg$crlf"; - print $fh "\t\t{$pguid}.$c.Build.0 = $cfg$crlf" if ($buildable == 1); - print $fh "\t\t{$pguid}.$c.Deploy.0 = $cfg$crlf" if ($deployable == 1); + print $fh "\t\t{$pguid}.$c.Build.0 = $cfg$crlf" if ($buildable); + print $fh "\t\t{$pguid}.$c.Deploy.0 = $cfg$crlf" if ($deployable); } } diff --git a/modules/VC8WorkspaceCreator.pm b/modules/VC8WorkspaceCreator.pm index 53b36a99..bd8dcdd4 100644 --- a/modules/VC8WorkspaceCreator.pm +++ b/modules/VC8WorkspaceCreator.pm @@ -62,7 +62,13 @@ sub post_workspace { ## non-managed c++ library or a "utility" project causes a warning in ## Visual Studio 2008 and higher. foreach my $project (@projects) { - my($name, $deps, $guid, $lang, $custom_only, $nocross, $managed) = @{$$pjs{$project}}; + my($name, $guid, $lang, $custom_only, $managed) = + $creator->access_pi_values($pjs, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::PROJECT_GUID, + ProjectCreator::LANGUAGE, + ProjectCreator::CUSTOM_ONLY, + ProjectCreator::MANAGED_PROJECT); $gmap{$name} = [$guid, !$custom_only && ($managed || $lang ne Creator::cplusplus)]; } @@ -78,8 +84,8 @@ sub post_workspace { my @read; my $crlf = $self->crlf(); my $cwd = $self->getcwd(); - my $lang = $$pjs{$project}->[3]; - my $managed = $$pjs{$project}->[6]; + my $lang = $$pjs{$project}->[ProjectCreator::LANGUAGE]; + my $managed = $$pjs{$project}->[ProjectCreator::MANAGED_PROJECT]; while(<$ph>) { ## This is a comment found in vc8.mpd if the project contains the diff --git a/modules/WB26WorkspaceCreator.pm b/modules/WB26WorkspaceCreator.pm index 70d4ed4b..3d2cb4ef 100644 --- a/modules/WB26WorkspaceCreator.pm +++ b/modules/WB26WorkspaceCreator.pm @@ -79,7 +79,7 @@ sub write_comps { ## Print out the target print $fh 'description.buildorder='; foreach my $project (@list) { - print $fh "$pre$$pjs{$project}->[0]/"; + print $fh $pre, $$pjs{$project}->[ProjectCreator::PROJECT_NAME], '/'; } print $fh $self->crlf(); } diff --git a/modules/WixWorkspaceCreator.pm b/modules/WixWorkspaceCreator.pm index b0a95f8b..9d3fff0d 100644 --- a/modules/WixWorkspaceCreator.pm +++ b/modules/WixWorkspaceCreator.pm @@ -67,7 +67,7 @@ sub normalize { } sub post_workspace { - my($self, $fh) = @_; + my($self, $fh, $gen) = @_; my $info = $self->get_project_info(); my $crlf = $self->crlf(); @@ -79,7 +79,8 @@ sub post_workspace { foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) { print $fh ' <ComponentGroupRef Id="ComponentGroup.', - $$info{$project}->[0], '" />', $crlf; + $$info{$project}->[ProjectCreator::PROJECT_NAME], '" />', + $crlf; } print $fh ' </ComponentGroup>', $crlf, @@ -94,18 +95,22 @@ sub post_workspace { my $projects = $self->get_projects(); my @list = $self->sort_dependencies($projects, 0); foreach my $project (@list) { - my $deps = $self->get_validated_ordering($project); - $project_dependencies{$project} = [ @$deps ]; + my $deps = $self->get_validated_ordering($project); + $project_dependencies{$project} = [ @$deps ]; } # for each project, find all dependencies foreach my $project (keys %project_dependencies) { - # foreach my $cfg (@cfgs_main) -> <configuration|platform> could be <Debug|AnyCPU Release|AnyCPU> or <Debug|Win32 Release|Win32 Debug|x64 Release|x64> - my($pname_main, $rawdeps_main, $guid_main, $language_main, $custom_only_main, $nocross_main, $managed_main, $make_group_main, @cfgs_main) = @{$$info{$project}}; - + # foreach my $cfg (@cfgs_main) -> <configuration|platform> could be <Debug|AnyCPU Release|AnyCPU> or <Debug|Win32 Release|Win32 Debug|x64 Release|x64> + my($pname_main, $make_group_main, @cfgs_main) = + $gen->access_pi_values($info, $project, + ProjectCreator::PROJECT_NAME, + ProjectCreator::MAKE_GROUP, + ProjectCreator::CONFIGURATIONS); # only generate a group if "make_group = 1" if ($make_group_main) { - my %all_deps = (); # all dependencies used by any project referenced by $project + # all dependencies used by any project referenced by $project + my %all_deps; my @dep_stack = ($project); while (my $top = pop @dep_stack) { # add current project to dependencies (use hash key as set) @@ -121,17 +126,24 @@ sub post_workspace { foreach my $cfg (@cfgs_main) { my ($config, $platform) = split('\|', $cfg); - print $fh ' <Fragment>'.$crlf; - print $fh ' <ComponentGroup Id="MainGroup.'.normalize($config).'_'.normalize($platform).'_'.$pname_main.'">'.$crlf; + print $fh ' <Fragment>', $crlf, + ' <ComponentGroup Id="MainGroup.', normalize($config), + '_', normalize($platform), '_', $pname_main, '">', $crlf; # add main project - pattern is "ComponentGroup.<Debug|Release>_<Win32|x64|AnyCPU>_<projectname>" - print $fh ' <ComponentGroupRef Id="ComponentGroup.'.normalize($config).'_'.normalize($platform).'_'.$pname_main.'" />'.$crlf; + print $fh ' <ComponentGroupRef Id="ComponentGroup.', + normalize($config), '_', normalize($platform), '_', + $pname_main, '" />', $crlf; # loop over each dependency, and obtain its parameters foreach my $dep (keys %all_deps) { foreach my $p (@{$self->{'projects'}}) { - if ($dep eq $self->{'project_info'}->{$p}->[0] || $dep eq $self->mpc_basename($p)) { - my($pname_dep, $rawdeps_dep, $guid_dep, $language_dep, $custom_only_dep, $nocross_dep, $managed_dep, $make_group_main, @cfgs_dep) = @{$$info{$p}}; + if ($dep eq $info->{$p}->[ProjectCreator::PROJECT_NAME] || + $dep eq $self->mpc_basename($p)) { + my($pname_dep, @cfgs_dep) = + $gen->access_pi_values($info, $p, + ProjectCreator::PROJECT_NAME, + ProjectCreator::CONFIGURATIONS); # add dependency - include AnyCPU if no dependency configuration matches exactly (if the AnyCPU platform exists, that is) my $pform = $platform; @@ -139,24 +151,22 @@ sub post_workspace { $pform = 'AnyCPU'; } if (exists {map { $_ => 1 } @cfgs_dep}->{$config.'|'.$pform}) { - print $fh ' <ComponentGroupRef Id="ComponentGroup.'.normalize($config).'_'.normalize($pform).'_'.$pname_dep.'" />'.$crlf; + print $fh ' <ComponentGroupRef Id="ComponentGroup.', + normalize($config), '_', normalize($pform), + '_', $pname_dep, '" />', $crlf; } - last; } } } - print $fh ' </ComponentGroup>'.$crlf; - print $fh ' </Fragment>'.$crlf; - print $fh $crlf; + print $fh ' </ComponentGroup>', $crlf, + ' </Fragment>', $crlf, $crlf; } - } } - - print $fh '</Include>'.$crlf; + print $fh '</Include>', $crlf; } 1; diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm index d4e28e55..ac2f1e96 100644 --- a/modules/WorkspaceCreator.pm +++ b/modules/WorkspaceCreator.pm @@ -1009,7 +1009,7 @@ sub write_workspace { ## Note that these name are handled case-insensitive by VC6 my %names; foreach my $project (@{$self->{'projects'}}) { - my $name = lc($self->{'project_info'}->{$project}->[0]); + my $name = lc($self->{'project_info'}->{$project}->[ProjectCreator::PROJECT_NAME]); if (defined $names{$name}) { ++$duplicates; $self->error("Duplicate case-insensitive project '$name'. " . @@ -1089,10 +1089,11 @@ sub write_workspace { print $dh "digraph $wsname {\n"; foreach my $project (@{$self->{'projects'}}) { if (defined $targnum{$project}) { - my $pname = $self->{'project_info'}->{$project}->[0]; + my $pname = $self->{'project_info'}->{$project}->[ProjectCreator::PROJECT_NAME]; foreach my $number (@{$targnum{$project}}) { print $dh " $pname -> ", - "$self->{'project_info'}->{$list[$number]}->[0];\n"; + $self->{'project_info'}->{$list[$number]}->[ProjectCreator::PROJECT_NAME], + ";\n"; } } } @@ -1418,12 +1419,12 @@ sub indirect_dependency { my($self, $dir, $ccheck, $cfile) = @_; $self->{'indirect_checked'}->{$ccheck} = 1; - if (index($self->{'project_info'}->{$ccheck}->[1], $cfile) >= 0) { + if (index($self->{'project_info'}->{$ccheck}->[ProjectCreator::DEPENDENCIES], $cfile) >= 0) { return 1; } else { my $deps = $self->create_array( - $self->{'project_info'}->{$ccheck}->[1]); + $self->{'project_info'}->{$ccheck}->[ProjectCreator::DEPENDENCIES]); foreach my $dep (@$deps) { if (defined $self->{'project_info'}->{"$dir$dep"} && !defined $self->{'indirect_checked'}->{"$dir$dep"} && @@ -1504,7 +1505,7 @@ sub add_implicit_project_dependencies { (!defined $self->{'project_info'}->{$ccheck} || !$self->indirect_dependency($dir, $ccheck, $cfile))) { ## Append the dependency - $self->{'project_info'}->{$file}->[1] .= " $append"; + $self->{'project_info'}->{$file}->[ProjectCreator::DEPENDENCIES] .= " $append"; } } } @@ -1608,7 +1609,7 @@ sub sort_within_group { if (defined $$deps[0]) { my $baseproj = ($self->{'dependency_is_filename'} ? $self->mpc_basename($$list[$i]) : - $self->{'project_info'}->{$$list[$i]}->[0]); + $self->{'project_info'}->{$$list[$i]}->[ProjectCreator::PROJECT_NAME]); my $moved = 0; foreach my $dep (@$deps) { if ($baseproj ne $dep) { @@ -1616,7 +1617,7 @@ sub sort_within_group { for(my $j = $i + 1; $j <= $end; ++$j) { my $ldep = ($self->{'dependency_is_filename'} ? $self->mpc_basename($$list[$j]) : - $self->{'project_info'}->{$$list[$j]}->[0]); + $self->{'project_info'}->{$$list[$j]}->[ProjectCreator::PROJECT_NAME]); if ($ldep eq $dep) { $movepjs = [$i, $j]; ## If so, move it in front of the current project. @@ -1870,7 +1871,7 @@ sub number_target_deps { ## the project file from the "project_info". my $key = ($self->{'dependency_is_filename'} ? $self->mpc_basename($list[$j]) : - $self->{'project_info'}->{$list[$j]}->[0]); + $self->{'project_info'}->{$list[$j]}->[ProjectCreator::PROJECT_NAME]); push(@numbers, $j) if (exists $dhash{$key}); } @@ -1892,7 +1893,7 @@ sub project_target_translation { ## some versions of make. foreach my $key (keys %{$self->{'project_info'}}) { my $dir = $self->mpc_dirname($key); - my $name = $self->{'project_info'}->{$key}->[0]; + my $name = $self->{'project_info'}->{$key}->[ProjectCreator::PROJECT_NAME]; ## We want to compare to the upper most directory. This will be the ## one that may conflict with the project name. @@ -2139,7 +2140,7 @@ sub get_validated_ordering { ## Avoid circular dependencies if ($dep ne $name && $dep ne $self->mpc_basename($project)) { foreach my $p (@{$self->{'projects'}}) { - if ($dep eq $self->{'project_info'}->{$p}->[0] || + if ($dep eq $self->{'project_info'}->{$p}->[ProjectCreator::PROJECT_NAME] || $dep eq $self->mpc_basename($p)) { $found = 1; last; diff --git a/templates/makedll.mpt b/templates/makedll.mpt index dbc2fd5f..a21736a5 100644 --- a/templates/makedll.mpt +++ b/templates/makedll.mpt @@ -304,7 +304,7 @@ lynxos { macosx { ranlib = 1 dll_ext = .dylib - shflags = -dynamic + shflags = -shared -dynamic } // I'm not sure if this is even useful anymore. |