Added build capability switches in the shared Windows props file so optional components are only enabled when their prerequisites exist:

Python3Enabled (python executable + import lib + cffi)
   PerlEnabled (perl executable + perl runtime DLL + gendef.exe)
   InstallerEnabled (Inno Setup iscc.exe).
Updated the Python plugin project to compile only when Python3Enabled is true, and otherwise emit a clear skip message instead of failing prebuild/import steps.
Updated the Perl plugin project similarly to gate build steps on PerlEnabled and print a skip message when prerequisites are missing.
Updated the installer project so it only uses C++ targets when InstallerEnabled is true, with a fallback skip message when Inno Setup is unavailable.
This commit is contained in:
2026-02-13 20:14:39 -07:00
parent bb70bcb4e3
commit a86dc5ae85
4 changed files with 27 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
@@ -27,7 +27,7 @@
<TargetName>hcperl</TargetName> <TargetName>hcperl</TargetName>
<OutDir>$(ZoiteChatRel)plugins\</OutDir> <OutDir>$(ZoiteChatRel)plugins\</OutDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(PerlEnabled)'=='true' and '$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(ZoiteChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(ZoiteChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -47,7 +47,7 @@ move irc.pm.h "$(IntDir)"
move zoitechat.pm.h "$(IntDir)"</Command> move zoitechat.pm.h "$(IntDir)"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(PerlEnabled)'=='true' and '$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(ZoiteChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(ZoiteChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -70,8 +70,11 @@ move zoitechat.pm.h "$(IntDir)"</Command>
<ItemGroup> <ItemGroup>
<None Include="perl.def" /> <None Include="perl.def" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup Condition="'$(PerlEnabled)'=='true'">
<ClCompile Include="perl.c" /> <ClCompile Include="perl.c" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(PerlEnabled)'=='true'" />
<Target Name="Build" Condition="'$(PerlEnabled)'!='true'">
<Message Text="Perl build prerequisites not found (perl/gendef/runtime); skipping Perl plugin build." Importance="high" />
</Target>
</Project> </Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
@@ -27,7 +27,7 @@
<TargetName>$(Python3Output)</TargetName> <TargetName>$(Python3Output)</TargetName>
<OutDir>$(ZoiteChatRel)plugins\</OutDir> <OutDir>$(ZoiteChatRel)plugins\</OutDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Python3Enabled)'=='true' and '$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -41,7 +41,7 @@
<Command>"$(Python3Path)\python.exe" generate_plugin.py ..\..\src\common\zoitechat-plugin.h python.py "$(IntDir)python.c"</Command> <Command>"$(Python3Path)\python.exe" generate_plugin.py ..\..\src\common\zoitechat-plugin.h python.py "$(IntDir)python.c"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Python3Enabled)'=='true' and '$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -63,8 +63,11 @@
<None Include="xchat.py" /> <None Include="xchat.py" />
<None Include="_zoitechat.py" /> <None Include="_zoitechat.py" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup Condition="'$(Python3Enabled)'=='true'">
<ClCompile Include="$(IntDir)python.c" /> <ClCompile Include="$(IntDir)python.c" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(Python3Enabled)'=='true'" />
<Target Name="Build" Condition="'$(Python3Enabled)'!='true'">
<Message Text="Python 3 build prerequisites not found (python/cffi/libs); skipping Python plugin build." Importance="high" />
</Target>
</Project> </Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
@@ -49,5 +49,8 @@ $(IsccPath) /dPROJECTDIR="$(ProjectDir)" /dAPPARCH="$(Platform)" "$(ZoiteChatBin
<None Include="wizardsmallimage.bmp" /> <None Include="wizardsmallimage.bmp" />
<None Include="zoitechat.iss" /> <None Include="zoitechat.iss" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(InstallerEnabled)'=='true'" />
<Target Name="Build" Condition="'$(InstallerEnabled)'!='true'">
<Message Text="Inno Setup (iscc.exe) not found; skipping installer build." Importance="high" />
</Target>
</Project> </Project>

View File

@@ -29,6 +29,12 @@
<Python3Path>$(YourPython3Path)\$(PlatformName)</Python3Path> <Python3Path>$(YourPython3Path)\$(PlatformName)</Python3Path>
<Python3Lib>python314</Python3Lib> <Python3Lib>python314</Python3Lib>
<Python3Output>hcpython3</Python3Output> <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>
<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>$(DepsRoot)\include\luajit-2.1;$(DepsRoot)\include\lua;$(DepsRoot)\include\lua5.1;$(DepsRoot)\include\lua54;$(DepsRoot)\include\lua5.4;$(DepsRoot)\include\lua-5.4;$(SolutionDir)..\plugins\lua\luajit\src;$(SolutionDir)..\plugins\lua\luajit\src\jit</LuaInclude> <LuaInclude>$(DepsRoot)\include\luajit-2.1;$(DepsRoot)\include\lua;$(DepsRoot)\include\lua5.1;$(DepsRoot)\include\lua54;$(DepsRoot)\include\lua5.4;$(DepsRoot)\include\lua-5.4;$(SolutionDir)..\plugins\lua\luajit\src;$(SolutionDir)..\plugins\lua\luajit\src\jit</LuaInclude>
<LuaOutput>hclua</LuaOutput> <LuaOutput>hclua</LuaOutput>
<LuaEnabled Condition="Exists('$(DepsRoot)\\include\\lua.h')">true</LuaEnabled> <LuaEnabled Condition="Exists('$(DepsRoot)\\include\\lua.h')">true</LuaEnabled>