contrib/buildsystems: ignore invalidcontinue.obj

Since 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX compatibility, 2014-03-29), invalidcontinue.obj is linked in the MSVC build, but it was not parsed correctly by the buildsystem. Ignore it, as it is known to Visual Studio and will be handled elsewhere. Also only substitute filenames ending with .o when generating the source .c filename, otherwise we would start to expect .cbj files to generate .obj files (which are not generated by our build)... In the future there may be source files that produce .obj files so keep the two issues (.obj files with & without source files) separate. Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Duncan Smart <duncan.smart@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philip Oakley committed Jul 29, 2019 at 13:08 UTC 865406bc5426d5196935e37a3a5fde9c843c3e96
1 file changed +7 -3
contrib/buildsystems/engine.pl
+7 -3
@@ -282,7 +282,7 @@ sub handleLibLine
282 # exit(1);
283 foreach (@objfiles) {
284 my $sourcefile = $_;
285 - $sourcefile =~ s/\.o/.c/;
285 + $sourcefile =~ s/\.o$/.c/;
286 push(@sources, $sourcefile);
287 push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
288 push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});
@@ -326,8 +326,12 @@ sub handleLinkLine
326 } elsif ($part =~ /\.(a|lib)$/) {
327 $part =~ s/\.a$/.lib/;
328 push(@libs, $part);
329 - } elsif ($part =~ /\.(o|obj)$/) {
329 + } elsif ($part eq 'invalidcontinue.obj') {
330 + # ignore - known to MSVC
331 + } elsif ($part =~ /\.o$/) {
332 push(@objfiles, $part);
333 + } elsif ($part =~ /\.obj$/) {
334 + # do nothing, 'make' should not be producing .obj, only .o files
335 } else {
336 die "Unhandled lib option @ line $lineno: $part";
337 }
@@ -336,7 +340,7 @@ sub handleLinkLine
340 # exit(1);
341 foreach (@objfiles) {
342 my $sourcefile = $_;
339 - $sourcefile =~ s/\.o/.c/;
343 + $sourcefile =~ s/\.o$/.c/;
344 push(@sources, $sourcefile);
345 push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
346 push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});