@@ -89,6 +89,16 @@ sub createProject {
89
89
$defines =~ s / >/ >/ g ;
90
90
$defines =~ s /\' // g ;
91
91
92
+ my $rcdefines = $defines ;
93
+ $rcdefines =~ s / (?<!\\ )"/ \\ $& / g ;
94
+
95
+ my $entrypoint = ' wmainCRTStartup' ;
96
+ my $subsystem = ' Console' ;
97
+ if (grep /^-mwindows$/ , @{$$build_structure {" $prefix${name} _LFLAGS" }}) {
98
+ $entrypoint = ' wWinMainCRTStartup' ;
99
+ $subsystem = ' Windows' ;
100
+ }
101
+
92
102
my $dir = $vcxproj ;
93
103
$dir =~ s /\/ [^\/ ]*$// ;
94
104
die " Could not create the directory $dir for $label project!\n " unless (-d " $dir " || mkdir " $dir " );
@@ -176,9 +186,9 @@ sub createProject {
176
186
<AdditionalLibraryDirectories>\$ (VCPKGLibDirectory);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
177
187
<AdditionalDependencies>\$ (VCPKGLibs);\$ (AdditionalDependencies)</AdditionalDependencies>
178
188
<AdditionalOptions>invalidcontinue.obj %(AdditionalOptions)</AdditionalOptions>
179
- <EntryPointSymbol>wmainCRTStartup </EntryPointSymbol>
189
+ <EntryPointSymbol>$entrypoint </EntryPointSymbol>
180
190
<ManifestFile>$cdup \\ compat\\ win32\\ git.manifest</ManifestFile>
181
- <SubSystem>Console </SubSystem>
191
+ <SubSystem>$subsystem </SubSystem>
182
192
</Link>
183
193
EOM
184
194
if ($target eq ' libgit' ) {
203
213
<PreprocessorDefinitions>WIN32;_DEBUG;$defines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
204
214
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
205
215
</ClCompile>
216
+ <ResourceCompile>
217
+ <PreprocessorDefinitions>WIN32;_DEBUG;$rcdefines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
218
+ </ResourceCompile>
206
219
<Link>
207
220
<GenerateDebugInformation>true</GenerateDebugInformation>
208
221
</Link>
216
229
<FunctionLevelLinking>true</FunctionLevelLinking>
217
230
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
218
231
</ClCompile>
232
+ <ResourceCompile>
233
+ <PreprocessorDefinitions>WIN32;NDEBUG;$rcdefines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
234
+ </ResourceCompile>
219
235
<Link>
220
236
<GenerateDebugInformation>true</GenerateDebugInformation>
221
237
<EnableCOMDATFolding>true</EnableCOMDATFolding>
225
241
<ItemGroup>
226
242
EOM
227
243
foreach (@sources ) {
228
- print F << "EOM" ;
244
+ if (/ \. rc$ / ) {
245
+ print F << "EOM" ;
246
+ <ResourceCompile Include="$_ " />
247
+ EOM
248
+ } else {
249
+ print F << "EOM" ;
229
250
<ClCompile Include="$_ " />
230
251
EOM
252
+ }
231
253
}
232
254
print F << "EOM" ;
233
255
</ItemGroup>
0 commit comments