diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm
index 81ee2f5a4a..58a48233c5 100644
--- a/contrib/buildsystems/Generators/Vcxproj.pm
+++ b/contrib/buildsystems/Generators/Vcxproj.pm
@@ -89,6 +89,9 @@ sub createProject {
$defines =~ s/>/>/g;
$defines =~ s/\'//g;
+ my $rcdefines = $defines;
+ $rcdefines =~ s/(?WIN32;_DEBUG;$defines;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
+
+ WIN32;_DEBUG;$rcdefines;%(PreprocessorDefinitions)
+
true
@@ -216,6 +222,9 @@ EOM
true
Speed
+
+ WIN32;NDEBUG;$rcdefines;%(PreprocessorDefinitions)
+
true
true
@@ -225,9 +234,15 @@ EOM
EOM
foreach(@sources) {
- print F << "EOM";
+ if (/\.rc$/) {
+ print F << "EOM";
+
+EOM
+ } else {
+ print F << "EOM";
EOM
+ }
}
print F << "EOM";
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 37b0b026f2..441059a737 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -165,7 +165,7 @@ sub parseMakeOutput
next;
}
- if($text =~ / -c /) {
+ if($text =~ / -c / || $text =~ / -i \S+\.rc /) {
# compilation
handleCompileLine($text, $line);
@@ -263,7 +263,7 @@ sub handleCompileLine
if ("$part" eq "-o") {
# ignore object file
shift @parts;
- } elsif ("$part" eq "-c") {
+ } elsif ("$part" eq "-c" || "$part" eq "-i") {
# ignore compile flag
} elsif ($part =~ /^.?-I/) {
push(@incpaths, $part);
@@ -271,7 +271,7 @@ sub handleCompileLine
push(@defines, $part);
} elsif ($part =~ /^-/) {
push(@cflags, $part);
- } elsif ($part =~ /\.(c|cc|cpp)$/) {
+ } elsif ($part =~ /\.(c|cc|cpp|rc)$/) {
$sourcefile = $part;
} else {
die "Unhandled compiler option @ line $lineno: $part";
@@ -358,7 +358,7 @@ sub handleLinkLine
push(@libs, $part);
} elsif ($part eq 'invalidcontinue.obj') {
# ignore - known to MSVC
- } elsif ($part =~ /\.o$/) {
+ } elsif ($part =~ /\.(o|res)$/) {
push(@objfiles, $part);
} elsif ($part =~ /\.obj$/) {
# do nothing, 'make' should not be producing .obj, only .o files
@@ -371,6 +371,7 @@ sub handleLinkLine
foreach (@objfiles) {
my $sourcefile = $_;
$sourcefile =~ s/\.o$/.c/;
+ $sourcefile =~ s/\.res$/.rc/;
push(@sources, $sourcefile);
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}});