diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2005-06-22 12:47:31 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2005-06-22 12:47:31 +0000 |
commit | f33176a121d8de5b94dc00e1125f76c7d7bfc7ad (patch) | |
tree | 0eac4404ca6d3adb74032a2a16fe401c0b949943 | |
parent | 0f01ae19ecb75e0d4ffbe16e2f333bfacc60864d (diff) | |
download | MPC-f33176a121d8de5b94dc00e1125f76c7d7bfc7ad.tar.gz |
ChangeLogTag: Wed Jun 22 07:43:33 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 19 | ||||
-rw-r--r-- | modules/TemplateParser.pm | 45 | ||||
-rw-r--r-- | templates/ghs.mpd | 3 | ||||
-rw-r--r-- | templates/nmake.mpd | 10 | ||||
-rw-r--r-- | templates/vc8.mpd | 7 |
6 files changed, 74 insertions, 34 deletions
@@ -1,3 +1,27 @@ +Wed Jun 22 07:43:33 2005 Chad Elliott <elliott_c@ociweb.com> + + * modules/ProjectCreator.pm: + + When adding generated files (and no generated file is listed), + only add those that match the default extension. + + * modules/TemplateParser.pm: + + When generating static projects, override the template settings + for the type_is_static, need_staticflags, type_is_dynamic, + type_is_binary variables. + + * templates/nmake.mpd: + + Fixed a bug where a custom command that generates multiple output + files and defines the output_option would not have the right + build rules. + + * templates/ghs.mpd: + * templates/vc8.mpd: + + Support the compile_flags template variable. + Tue Jun 21 11:55:38 2005 Chad Elliott <elliott_c@ociweb.com> * modules/BMakeProjectCreator.pm: diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 3b284f05..a7469797 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -2362,10 +2362,9 @@ sub generate_default_components { my($pchc) = $self->get_assignment('pch_source'); my($recurse) = $self->get_assignment('recurse'); - ## The order of @tags may make a difference in the way that generated + ## The order of @tags does make a difference in the way that generated ## files get added. And since the tags are user definable, there may be - ## a problem with that. I can not confirm that this can actually cause a - ## problem, so I am leaving it alone. + ## a problem with that. foreach my $tag (@tags) { if (!defined $self->{'generated_exts'}->{$tag} || $self->{'generated_exts'}->{$tag}->{'automatic'}) { @@ -2457,11 +2456,21 @@ sub generate_default_components { } } if (!$found) { - push(@front, @files); + my($ext) = $$exts[0]; + foreach my $file (@files) { + if ($file =~ /$ext$/) { + push(@front, $file); + } + } } } else { - push(@front, @files); + my($ext) = $$exts[0]; + foreach my $file (@files) { + if ($file =~ /$ext$/) { + push(@front, $file); + } + } } } if ($#copy != -1) { diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 0b81989b..1f57e6d1 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -60,6 +60,12 @@ my(%keywords) = ('if' => 0, 'duplicate_index' => 5, ); +my(%target_type_vars) = ('type_is_static' => 1, + 'need_staticflags' => 1, + 'type_is_dynamic' => 1, + 'type_is_binary' => 1, + ); + # ************************************************************ # Subroutine Section # ************************************************************ @@ -69,22 +75,23 @@ sub new { my($prjc) = shift; my($self) = $class->SUPER::new(); - $self->{'prjc'} = $prjc; - $self->{'ti'} = $prjc->get_template_input(); - $self->{'cslashes'} = $prjc->convert_slashes(); - $self->{'crlf'} = $prjc->crlf(); - $self->{'cmds'} = $prjc->get_command_subs(); - $self->{'vnames'} = $prjc->get_valid_names(); - $self->{'values'} = {}; - $self->{'defaults'} = {}; - $self->{'lines'} = []; - $self->{'built'} = ''; - $self->{'sstack'} = []; - $self->{'lstack'} = []; - $self->{'if_skip'} = 0; - $self->{'eval'} = 0; - $self->{'eval_str'} = ''; - $self->{'dupfiles'} = {}; + $self->{'prjc'} = $prjc; + $self->{'ti'} = $prjc->get_template_input(); + $self->{'cslashes'} = $prjc->convert_slashes(); + $self->{'crlf'} = $prjc->crlf(); + $self->{'cmds'} = $prjc->get_command_subs(); + $self->{'vnames'} = $prjc->get_valid_names(); + $self->{'values'} = {}; + $self->{'defaults'} = {}; + $self->{'lines'} = []; + $self->{'built'} = ''; + $self->{'sstack'} = []; + $self->{'lstack'} = []; + $self->{'if_skip'} = 0; + $self->{'eval'} = 0; + $self->{'eval_str'} = ''; + $self->{'dupfiles'} = {}; + $self->{'override_target_type'} = undef; $self->{'foreach'} = {}; $self->{'foreach'}->{'count'} = -1; @@ -240,6 +247,11 @@ sub get_value { --$counter; } $counter = $self->{'foreach'}->{'count'}; + + if ($self->{'override_target_type'} && + defined $value && defined $target_type_vars{$name}) { + $value = $self->{'values'}->{$name}; + } } if (!defined $value) { @@ -1474,6 +1486,7 @@ sub collect_data { my($sharedname) = $prjc->get_assignment('sharedname'); my($staticname) = $prjc->get_assignment('staticname'); if (!defined $sharedname && defined $staticname) { + $self->{'override_target_type'} = 1; $self->{'values'}->{'type_is_static'} = 1; $self->{'values'}->{'need_staticflags'} = 1; } diff --git a/templates/ghs.mpd b/templates/ghs.mpd index c1a3e80e..adbee53e 100644 --- a/templates/ghs.mpd +++ b/templates/ghs.mpd @@ -103,6 +103,9 @@ default: <%foreach(source_files)%> <%source_file%> C++ +<%if(compile_flags)%> + :cxx_compiler.args=<%compile_flags%> +<%endif%> <%endfor%> <%foreach(header_files)%> <%header_file%> diff --git a/templates/nmake.mpd b/templates/nmake.mpd index 7d0a03a6..00657bd6 100644 --- a/templates/nmake.mpd +++ b/templates/nmake.mpd @@ -281,15 +281,9 @@ InputPath=<%custom_type->input_file%> PATH=%PATH%;<%custom_type->libpath%> <%endif%> <%if(flag_overrides(custom_type->input_file, gendir))%> - @if not exist <%flag_overrides(custom_type->input_file, gendir)%> mkdir <%flag_overrides(custom_type->input_file, gendir)%> -<%endif%> -<%if(custom_type->output_option)%> -<%foreach(custom_type->input_file->output_files)%> - <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> "$(InputPath)" <%custom_type->output_option%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" -<%endfor%> -<%else%> - <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> "$(InputPath)" + if not exist <%flag_overrides(custom_type->input_file, gendir)%> mkdir <%flag_overrides(custom_type->input_file, gendir)%> <%endif%> + <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> "$(InputPath)"<%if(custom_type->output_option)%> <%custom_type->output_option%><%foreach(custom_type->input_file->output_files)%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>"<%endfor%><%endif%> <%if(flag_overrides(custom_type->input_file, postcommand))%> <%foreach(custom_type->input_file)%> <%flag_overrides(custom_type->input_file, postcommand)%> diff --git a/templates/vc8.mpd b/templates/vc8.mpd index 23347fb4..bc56579c 100644 --- a/templates/vc8.mpd +++ b/templates/vc8.mpd @@ -48,8 +48,8 @@ /> <Tool Name="VCCLCompilerTool" -<%if(compile_options)%> - AdditionalOptions="<%compile_options%>" +<%if(compile_flags)%> + AdditionalOptions="<%compile_flags%>" <%endif%> Optimization="<%optimize("0")%>" <%if(InlineFunctionExpansion)%> @@ -271,9 +271,6 @@ <%if(type_is_binary)%> AdditionalDependencies="<%foreach(reverse(libs))%><%fornotfirst(" ")%><%lib%><%lib_modifier%><%lib_ext%><%endfor%><%foreach(reverse(lit_libs))%> <%lit_lib%>.lib<%endfor%><%foreach(reverse(pure_libs))%> <%pure_lib%><%endfor%>" <%endif%> -<%if()%> - ="<%%>" -<%endif%> <%if(exename || sharedname || staticname)%> OutputFile="$(OutDir)\<%if(type_is_dynamic)%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" <%endif%> |