<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<PropertyGroup Label="UserMacros">

		<!-- SPECIFY YOUR DEPENDENCY DIRECTORIES HERE -->

		<YourDepsPath>c:\gtk-build\gtk</YourDepsPath>
		<YourGendefPath>c:\gtk-build\gendef</YourGendefPath>
		<YourPerlPath>c:\gtk-build\perl-5.42.0.1</YourPerlPath>
		<YourPython3Path>c:\gtk-build\python-3.14</YourPython3Path>
		<YourPython38Path>c:\gtk-build\python-3.8</YourPython38Path>
		<YourWinSparklePath>c:\gtk-build\WinSparkle</YourWinSparklePath>

		<!-- YOU SHOULDN'T TOUCH ANYTHING BELOW -->

		<!-- Force x64 only -->
		<ZoiteChatPlatform>x64</ZoiteChatPlatform>

		<!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* -->
		<!-- must be buildable with GSEAL_ENABLE in the future, xtext, setup, and chanview-tabs stand in the way -->
		<OwnFlags>GTK_DISABLE_DEPRECATED;GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_X509_GET_SIGNATURE_NID;HAVE_SSL_CTX_GET_SSL_METHOD;DEFAULT_CERT_FILE="cert.pem";HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline</OwnFlags>

		<!-- FIXME: Add ability to use debug builds -->
		<DepsRoot>$(YourDepsPath)\$(ZoiteChatPlatform)\release</DepsRoot>
		<GendefPath>$(YourGendefPath)</GendefPath>
		<WinSparklePath>$(YourWinSparklePath)\$(ZoiteChatPlatform)</WinSparklePath>
		<PerlPath>$(YourPerlPath)\$(ZoiteChatPlatform)</PerlPath>
		<PerlLib>perl542</PerlLib>

		<Python3Path>$(YourPython3Path)\$(ZoiteChatPlatform)</Python3Path>
		<Python3Lib>python314</Python3Lib>
		<Python3Output>hcpython3</Python3Output>
		<Python3Enabled Condition="Exists('$(Python3Path)\\python.exe') and Exists('$(Python3Path)\\libs\\$(Python3Lib).lib') and Exists('$(Python3Path)\\Lib\\site-packages\\cffi')">true</Python3Enabled>
		<Python3Enabled Condition="'$(Python3Enabled)'==''">false</Python3Enabled>

		<Python38Path>$(YourPython38Path)\$(ZoiteChatPlatform)</Python38Path>
		<Python38Lib>python38</Python38Lib>
		<Python38Output>hcpython38</Python38Output>
		<Python38Enabled Condition="Exists('$(Python38Path)\\python.exe') and Exists('$(Python38Path)\\libs\\$(Python38Lib).lib') and Exists('$(Python38Path)\\Lib\\site-packages\\cffi')">true</Python38Enabled>
		<Python38Enabled Condition="'$(Python38Enabled)'==''">false</Python38Enabled>

		<PerlEnabled Condition="Exists('$(PerlPath)\\bin\\perl.exe') and Exists('$(PerlPath)\\bin\\$(PerlLib).dll') and Exists('$(GendefPath)\\gendef.exe')">true</PerlEnabled>
		<PerlEnabled Condition="'$(PerlEnabled)'==''">false</PerlEnabled>

		<InstallerEnabled Condition="Exists('$(IsccPath)')">true</InstallerEnabled>
		<InstallerEnabled Condition="'$(InstallerEnabled)'==''">false</InstallerEnabled>

		<LuaInclude Condition="Exists('$(DepsRoot)\include\luajit-2.1\lua.h')">$(DepsRoot)\include\luajit-2.1</LuaInclude>
		<LuaInclude Condition="'$(LuaInclude)'=='' and Exists('$(DepsRoot)\include\luajit\lua.h')">$(DepsRoot)\include\luajit</LuaInclude>
		<LuaInclude Condition="'$(LuaInclude)'=='' and Exists('$(DepsRoot)\include\lua5.1\lua.h')">$(DepsRoot)\include\lua5.1</LuaInclude>
		<LuaInclude Condition="'$(LuaInclude)'=='' and Exists('$(DepsRoot)\include\lua51\lua.h')">$(DepsRoot)\include\lua51</LuaInclude>
		<LuaOutput>hclua</LuaOutput>

		<LuaLib Condition="Exists('$(DepsRoot)\lib\lua51.lib')">lua51</LuaLib>
		<LuaLib Condition="'$(LuaLib)'=='' and Exists('$(DepsRoot)\lib\luajit-5.1.lib')">luajit-5.1</LuaLib>
		<LuaLib Condition="'$(LuaLib)'=='' and Exists('$(DepsRoot)\lib\luajit.lib')">luajit</LuaLib>
		<LuaEnabled Condition="'$(LuaInclude)'!='' and '$(LuaLib)'!=''">true</LuaEnabled>

		<LuaRuntimeDll Condition="Exists('$(DepsRoot)\bin\lua51.dll')">lua51.dll</LuaRuntimeDll>
		<LuaRuntimeDll Condition="'$(LuaRuntimeDll)'=='' and Exists('$(DepsRoot)\bin\luajit-5.1.dll')">luajit-5.1.dll</LuaRuntimeDll>
		<LuaRuntimeDll Condition="'$(LuaRuntimeDll)'=='' and Exists('$(DepsRoot)\bin\luajit.dll')">luajit.dll</LuaRuntimeDll>

		<LuaShareDir Condition="Exists('$(DepsRoot)\share\lua\2.1\lgi\init.lua')">$(DepsRoot)\share\lua\2.1</LuaShareDir>
		<LuaShareDir Condition="'$(LuaShareDir)'=='' and Exists('$(DepsRoot)\share\lua\5.1\lgi\init.lua')">$(DepsRoot)\share\lua\5.1</LuaShareDir>

		<LuaLibDir Condition="Exists('$(DepsRoot)\lib\lua\2.1\lgi')">$(DepsRoot)\lib\lua\2.1</LuaLibDir>
		<LuaLibDir Condition="'$(LuaLibDir)'=='' and Exists('$(DepsRoot)\lib\lua\5.1\lgi')">$(DepsRoot)\lib\lua\5.1</LuaLibDir>

		<LuaEnabled Condition="'$(LuaEnabled)'==''">false</LuaEnabled>

		<GlibGenMarshal Condition="Exists('$(DepsRoot)\bin\glib-genmarshal.exe')">"$(DepsRoot)\bin\glib-genmarshal.exe"</GlibGenMarshal>
		<GlibGenMarshal Condition="'$(GlibGenMarshal)'=='' and Exists('$(DepsRoot)\bin\glib-genmarshal') and Exists('$(Python3Path)\python.exe')">"$(Python3Path)\python.exe" "$(DepsRoot)\bin\glib-genmarshal"</GlibGenMarshal>

		<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib>

		<UsingGtk3 Condition="Exists('$(DepsRoot)\\include\\gtk-3.0\\gtk\\gtk.h')">true</UsingGtk3>
		<Gtk3>$(DepsRoot)\include\gtk-3.0;$(DepsRoot)\lib\gtk-3.0\include</Gtk3>
		<GtkCommon>$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0;$(DepsRoot)\include\harfbuzz</GtkCommon>
		<Gtk>$(Gtk3);$(GtkCommon)</Gtk>

		<SslLegacyLib Condition="Exists('$(DepsRoot)\\lib\\ssleay32.lib')">ssleay32.lib</SslLegacyLib>
		<CryptoLegacyLib Condition="Exists('$(DepsRoot)\\lib\\libeay32.lib')">libeay32.lib</CryptoLegacyLib>
		<SslModernLib Condition="Exists('$(DepsRoot)\\lib\\libssl.lib')">libssl.lib</SslModernLib>
		<CryptoModernLib Condition="Exists('$(DepsRoot)\\lib\\libcrypto.lib')">libcrypto.lib</CryptoModernLib>

		<OpenSslLibs Condition="'$(SslModernLib)' != '' and '$(CryptoModernLib)' != ''">$(SslModernLib);$(CryptoModernLib)</OpenSslLibs>
		<OpenSslLibs Condition="'$(OpenSslLibs)' == '' and '$(SslLegacyLib)' != '' and '$(CryptoLegacyLib)' != ''">$(SslLegacyLib);$(CryptoLegacyLib)</OpenSslLibs>
		<OpenSslInclude Condition="Exists('$(DepsRoot)\\include\\openssl\\ssl.h')">$(DepsRoot)\include</OpenSslInclude>

		<!-- Resolve library names across dependency bundles -->
		<Gtk3Lib Condition="Exists('$(DepsRoot)\lib\gtk-3.lib')">gtk-3.lib</Gtk3Lib>
		<Gtk3Lib Condition="'$(Gtk3Lib)'=='' and Exists('$(DepsRoot)\lib\gtk-3.0.lib')">gtk-3.0.lib</Gtk3Lib>
		<Gtk3Lib Condition="'$(Gtk3Lib)'=='' and Exists('$(DepsRoot)\lib\libgtk-3.lib')">libgtk-3.lib</Gtk3Lib>
		<Gtk3Lib Condition="'$(Gtk3Lib)'=='' and Exists('$(DepsRoot)\lib\libgtk-3.0.lib')">libgtk-3.0.lib</Gtk3Lib>

		<Gdk3Lib Condition="Exists('$(DepsRoot)\lib\gdk-3.lib')">gdk-3.lib</Gdk3Lib>
		<Gdk3Lib Condition="'$(Gdk3Lib)'=='' and Exists('$(DepsRoot)\lib\gdk-3.0.lib')">gdk-3.0.lib</Gdk3Lib>
		<Gdk3Lib Condition="'$(Gdk3Lib)'=='' and Exists('$(DepsRoot)\lib\libgdk-3.lib')">libgdk-3.lib</Gdk3Lib>
		<Gdk3Lib Condition="'$(Gdk3Lib)'=='' and Exists('$(DepsRoot)\lib\libgdk-3.0.lib')">libgdk-3.0.lib</Gdk3Lib>

		<IntlLib Condition="Exists('$(DepsRoot)\lib\intl.lib')">intl.lib</IntlLib>
		<IntlLib Condition="'$(IntlLib)'=='' and Exists('$(DepsRoot)\lib\libintl.lib')">libintl.lib</IntlLib>

		<IconvLib Condition="Exists('$(DepsRoot)\lib\iconv.lib')">iconv.lib</IconvLib>
		<IconvLib Condition="'$(IconvLib)'=='' and Exists('$(DepsRoot)\lib\libiconv.lib')">libiconv.lib</IconvLib>

		<ZlibLib Condition="Exists('$(DepsRoot)\lib\zlib1.lib')">zlib1.lib</ZlibLib>
		<ZlibLib Condition="'$(ZlibLib)'=='' and Exists('$(DepsRoot)\lib\zlib.lib')">zlib.lib</ZlibLib>

		<Xml2Lib Condition="Exists('$(DepsRoot)\lib\libxml2.lib')">libxml2.lib</Xml2Lib>
		<Xml2Lib Condition="'$(Xml2Lib)'=='' and Exists('$(DepsRoot)\lib\xml2.lib')">xml2.lib</Xml2Lib>
		<Xml2Lib Condition="'$(Xml2Lib)'=='' and Exists('$(DepsRoot)\lib\libxml2-2.lib')">libxml2-2.lib</Xml2Lib>

		<JpegLib Condition="Exists('$(DepsRoot)\lib\jpeg.lib')">jpeg.lib</JpegLib>
		<JpegLib Condition="'$(JpegLib)'=='' and Exists('$(DepsRoot)\lib\libjpeg.lib')">libjpeg.lib</JpegLib>
		<JpegLib Condition="'$(JpegLib)'=='' and Exists('$(DepsRoot)\lib\libjpeg-8.lib')">libjpeg-8.lib</JpegLib>
		<JpegLib Condition="'$(JpegLib)'=='' and Exists('$(DepsRoot)\lib\libjpeg-9.lib')">libjpeg-9.lib</JpegLib>

		<PngLib Condition="Exists('$(DepsRoot)\lib\libpng16.lib')">libpng16.lib</PngLib>
		<PngLib Condition="'$(PngLib)'=='' and Exists('$(DepsRoot)\lib\libpng16_static.lib')">libpng16_static.lib</PngLib>
		<PngLib Condition="'$(PngLib)'=='' and Exists('$(DepsRoot)\lib\libpng.lib')">libpng.lib</PngLib>

		<ArchiveLibDir Condition="'$(ArchiveLibDir)'==''">$(DepsRoot)\lib</ArchiveLibDir>

		<ArchiveInclude Condition="Exists('$(DepsRoot)\include\archive.h') and Exists('$(DepsRoot)\include\archive_entry.h')">$(DepsRoot)\include</ArchiveInclude>
		<ArchiveInclude Condition="'$(ArchiveInclude)'=='' and Exists('$(DepsRoot)\include\archive\archive.h')">$(DepsRoot)\include\archive</ArchiveInclude>
		<ArchiveInclude Condition="'$(ArchiveInclude)'=='' and Exists('$(DepsRoot)\include\libarchive\archive.h')">$(DepsRoot)\include\libarchive</ArchiveInclude>

		<ArchiveLib Condition="Exists('$(ArchiveLibDir)\archive.lib')">archive.lib</ArchiveLib>
		<ArchiveLib Condition="'$(ArchiveLib)'=='' and Exists('$(ArchiveLibDir)\libarchive.lib')">libarchive.lib</ArchiveLib>
		<ArchiveLib Condition="'$(ArchiveLib)'=='' and Exists('$(ArchiveLibDir)\archive-13.lib')">archive-13.lib</ArchiveLib>
		<ArchiveLib Condition="'$(ArchiveLib)'=='' and Exists('$(ArchiveLibDir)\libarchive-13.lib')">libarchive-13.lib</ArchiveLib>
		<ArchiveLib Condition="'$(ArchiveLib)'=='' and Exists('$(ArchiveLibDir)\archive_static.lib')">archive_static.lib</ArchiveLib>
		<ArchiveLib Condition="'$(ArchiveLib)'=='' and Exists('$(ArchiveLibDir)\libarchive_static.lib')">libarchive_static.lib</ArchiveLib>

		<ArchiveDefs Condition="'$(ArchiveLib)'=='archive_static.lib' or '$(ArchiveLib)'=='libarchive_static.lib'">LIBARCHIVE_STATIC</ArchiveDefs>

		<DepLibs>$(Gtk3Lib);$(Gdk3Lib);wininet.lib;winmm.lib;ws2_32.lib;advapi32.lib;atk-1.0.lib;gio-2.0.lib;gdk_pixbuf-2.0.lib;pangowin32-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo.lib;gobject-2.0.lib;gmodule-2.0.lib;glib-2.0.lib;$(IntlLib);$(IconvLib);$(ZlibLib);$(Xml2Lib);$(JpegLib);$(PngLib);$(ArchiveLib);$(OpenSslLibs)</DepLibs>

		<DataDir>$(SolutionDir)..\data\\</DataDir>
		<ZoiteChatBuild>$(SolutionDir)..\..\zoitechat-build</ZoiteChatBuild>
		<ZoiteChatBin>$(ZoiteChatBuild)\$(ZoiteChatPlatform)\bin\</ZoiteChatBin>
		<ZoiteChatObj>$(ZoiteChatBuild)\$(ZoiteChatPlatform)\obj\</ZoiteChatObj>
		<ZoiteChatLib>$(ZoiteChatBuild)\$(ZoiteChatPlatform)\lib\</ZoiteChatLib>
		<ZoiteChatPdb>$(ZoiteChatBuild)\$(ZoiteChatPlatform)\pdb\</ZoiteChatPdb>
		<ZoiteChatRel>$(ZoiteChatBuild)\$(ZoiteChatPlatform)\rel\</ZoiteChatRel>

		<IsccPath Condition="'$(IsccPath)'=='' and Exists('$(ProgramFiles(x86))\Inno Setup 6\ISCC.exe')">"$(ProgramFiles(x86))\Inno Setup 6\ISCC.exe"</IsccPath>
		<IsccPath Condition="'$(IsccPath)'=='' and Exists('$(ProgramFiles)\Inno Setup 6\ISCC.exe')">"$(ProgramFiles)\Inno Setup 6\ISCC.exe"</IsccPath>
	</PropertyGroup>

	<!-- If someone tries Win32, stop immediately. -->
	<PropertyGroup>
		<_ZoiteChatPlatformMismatch Condition="'$(Platform)'!='x64' and '$(PlatformName)'!='x64'">true</_ZoiteChatPlatformMismatch>
	</PropertyGroup>
	<Target Name="ZoiteChatPropsEnforceX64" BeforeTargets="PrepareForBuild" Condition="'$(_ZoiteChatPlatformMismatch)'=='true'">
		<Error Text="zoitechat.props is configured for x64 only. Set the Solution/Project Platform to x64." />
	</Target>

	<PropertyGroup>
		<LinkIncremental>false</LinkIncremental>
		<IntDir>$(ZoiteChatObj)$(ProjectName)\</IntDir>
		<UseDebugLibraries>false</UseDebugLibraries>
		<WholeProgramOptimization>true</WholeProgramOptimization>
		<CharacterSet>MultiByte</CharacterSet>
	</PropertyGroup>

	<ItemDefinitionGroup>
		<ClCompile>
			<WarningLevel>Level3</WarningLevel>
			<PrecompiledHeader>NotUsing</PrecompiledHeader>
			<DisableSpecificWarnings>4996</DisableSpecificWarnings>
			<BasicRuntimeChecks>Default</BasicRuntimeChecks>
			<SmallerTypeCheck>false</SmallerTypeCheck>
			<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
			<WholeProgramOptimization>false</WholeProgramOptimization>
			<!-- UNCOMMENT ONLY ONE -->
			<!--<Optimization>Disabled</Optimization>-->
			<!--Optimization>MaxSpeed</Optimization-->
			<!--Optimization>MinSpace</Optimization-->
			<Optimization>Full</Optimization>
			<FunctionLevelLinking>true</FunctionLevelLinking>
			<IntrinsicFunctions>true</IntrinsicFunctions>
			<MultiProcessorCompilation>true</MultiProcessorCompilation>
			<PreProcessorDefinitions>NTDDI_VERSION=NTDDI_WIN8;_WIN32_WINNT=_WIN32_WINNT_WIN8;$(ArchiveDefs);%(PreProcessorDefinitions)</PreProcessorDefinitions>
		</ClCompile>
		<Lib>
			<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
		</Lib>
		<Link>
			<ImportLibrary>$(ZoiteChatLib)$(TargetName).lib</ImportLibrary>
			<ProgramDatabaseFile>$(ZoiteChatPdb)$(TargetName).pdb</ProgramDatabaseFile>
			<SubSystem>Windows</SubSystem>
			<GenerateDebugInformation>Debug</GenerateDebugInformation>
			<EnableCOMDATFolding>true</EnableCOMDATFolding>
			<OptimizeReferences>true</OptimizeReferences>
			<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
		</Link>
	</ItemDefinitionGroup>

	<ItemGroup />
</Project>
