@@ -76,7 +76,7 @@ sub createProject {
7676
7777 my $libs_release = " \n " ;
7878 my $libs_debug = " \n " ;
79- if (!$static_library ) {
79+ if (!$static_library && $name ne ' headless-git ' ) {
8080 $libs_release = join (" ;" , sort (grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib)/, @{$$build_structure {" $prefix${name} _LIBS" }}));
8181 $libs_debug = $libs_release ;
8282 $libs_debug =~ s / zlib\. lib/ zlibd\. lib/ g ;
@@ -89,6 +89,16 @@ sub createProject {
8989 $defines =~ s / >/ >/ g ;
9090 $defines =~ s /\' // g ;
9191
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+
92102 my $dir = $vcxproj ;
93103 $dir =~ s /\/ [^\/ ]*$// ;
94104 die " Could not create the directory $dir for $label project!\n " unless (-d " $dir " || mkdir " $dir " );
@@ -185,9 +195,9 @@ sub createProject {
185195 <AdditionalLibraryDirectories>\$ (VCPKGLibDirectory);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
186196 <AdditionalDependencies>\$ (VCPKGLibs);\$ (AdditionalDependencies)</AdditionalDependencies>
187197 <AdditionalOptions>invalidcontinue.obj %(AdditionalOptions)</AdditionalOptions>
188- <EntryPointSymbol>wmainCRTStartup </EntryPointSymbol>
198+ <EntryPointSymbol>$entrypoint </EntryPointSymbol>
189199 <ManifestFile>$cdup \\ compat\\ win32\\ git.manifest</ManifestFile>
190- <SubSystem>Console </SubSystem>
200+ <SubSystem>$subsystem </SubSystem>
191201 </Link>
192202EOM
193203 if ($target eq ' libgit' ) {
212222 <PreprocessorDefinitions>WIN32;_DEBUG;$defines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
213223 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
214224 </ClCompile>
225+ <ResourceCompile>
226+ <PreprocessorDefinitions>WIN32;_DEBUG;$rcdefines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
227+ </ResourceCompile>
215228 <Link>
216229 <GenerateDebugInformation>true</GenerateDebugInformation>
217230 </Link>
225238 <FunctionLevelLinking>true</FunctionLevelLinking>
226239 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
227240 </ClCompile>
241+ <ResourceCompile>
242+ <PreprocessorDefinitions>WIN32;NDEBUG;$rcdefines ;%(PreprocessorDefinitions)</PreprocessorDefinitions>
243+ </ResourceCompile>
228244 <Link>
229245 <GenerateDebugInformation>true</GenerateDebugInformation>
230246 <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -234,14 +250,20 @@ EOM
234250 <ItemGroup>
235251EOM
236252 foreach (@sources ) {
237- print F << "EOM" ;
253+ if (/ \. rc$ / ) {
254+ print F << "EOM" ;
255+ <ResourceCompile Include="$_ " />
256+ EOM
257+ } else {
258+ print F << "EOM" ;
238259 <ClCompile Include="$_ " />
239260EOM
261+ }
240262 }
241263 print F << "EOM" ;
242264 </ItemGroup>
243265EOM
244- if (!$static_library || $target =~ ' vcs-svn' || $target =~ ' xdiff' ) {
266+ if (( !$static_library || $target =~ ' vcs-svn' || $target =~ ' xdiff' ) && !( $name =~ / headless-git / ) ) {
245267 my $uuid_libgit = $$build_structure {" LIBS_libgit_GUID" };
246268 my $uuid_xdiff_lib = $$build_structure {" LIBS_xdiff/lib_GUID" };
247269
0 commit comments