Skip to content

Commit ddaa241

Browse files
Philip Oakleyduncansmart
authored andcommitted
engine.pl: ignore invalidcontinue.obj which is known to MSVC
Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX compatibility, 2014-03-29) introduced invalidcontinue.obj into the Makefile output, which was not parsed correctly by the buildsystem. Ignore it, as it is known to Visual Studio and, there is no matching source file. Only substitute filenames ending with .o when generating the source .c filename, otherwise a .cbj file may be expected. Split the .o and .obj processing; 'make' does not produce .obj files. 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 <[email protected]> Signed-off-by: Duncan Smart <[email protected]> (cherry picked from commit d01d71f)
1 parent c6f19b0 commit ddaa241

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contrib/buildsystems/engine.pl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ sub handleLibLine
282282
# exit(1);
283283
foreach (@objfiles) {
284284
my $sourcefile = $_;
285-
$sourcefile =~ s/\.o/.c/;
285+
$sourcefile =~ s/\.o$/.c/;
286286
push(@sources, $sourcefile);
287287
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
288288
push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});
@@ -326,8 +326,12 @@ sub handleLinkLine
326326
} elsif ($part =~ /\.(a|lib)$/) {
327327
$part =~ s/\.a$/.lib/;
328328
push(@libs, $part);
329-
} elsif ($part =~ /\.(o|obj)$/) {
329+
} elsif ($part eq 'invalidcontinue.obj') {
330+
# ignore - known to MSVC
331+
} elsif ($part =~ /\.o$/) {
330332
push(@objfiles, $part);
333+
} elsif ($part =~ /\.obj$/) {
334+
# do nothing, 'make' should not be producing .obj, only .o files
331335
} else {
332336
die "Unhandled lib option @ line $lineno: $part";
333337
}
@@ -336,7 +340,7 @@ sub handleLinkLine
336340
# exit(1);
337341
foreach (@objfiles) {
338342
my $sourcefile = $_;
339-
$sourcefile =~ s/\.o/.c/;
343+
$sourcefile =~ s/\.o$/.c/;
340344
push(@sources, $sourcefile);
341345
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
342346
push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});

0 commit comments

Comments
 (0)