Skip to content

Commit

Permalink
[windows] simplify *.vcxproj files by removing duplicates and moving …
Browse files Browse the repository at this point in the history
…the most of the common properties to the imported boinc.props and pch.props files

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
  • Loading branch information
AenBleidd committed Sep 15, 2024
1 parent a2b61ad commit d502607
Show file tree
Hide file tree
Showing 44 changed files with 461 additions and 8,649 deletions.
14 changes: 2 additions & 12 deletions set-vboxwrapper-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,8 @@ def set_vcxproj(version):
lines = f.readlines()
with open(vcxproj, 'w') as f:
for line in lines:
if line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">vboxwrapper_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">vboxwrapper_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">vboxwrapper_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">vboxwrapper_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">vboxwrapper_{version}_windows_arm64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">vboxwrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">vboxwrapper_{version}_windows_arm64</TargetName>\n'
if line.startswith(' <TargetVersion>'):
line = f' <TargetVersion>{version}</TargetVersion>\n'
f.write(line)

if (len(sys.argv) != 2):
Expand Down
14 changes: 2 additions & 12 deletions set-worker-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,8 @@ def set_vcxproj(version):
lines = f.readlines()
with open(vcxproj, 'w') as f:
for line in lines:
if line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">worker_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">worker_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">worker_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">worker_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">worker_{version}_windows_arm64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">worker_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">worker_{version}_windows_arm64</TargetName>\n'
if line.startswith(' <TargetVersion>'):
line = f' <TargetVersion>{version}</TargetVersion>\n'
f.write(line)

if (len(sys.argv) != 2):
Expand Down
14 changes: 2 additions & 12 deletions set-wrapper-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,8 @@ def set_vcxproj(version):
lines = f.readlines()
with open(vcxproj, 'w') as f:
for line in lines:
if line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|x64\'">wrapper_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|x64\'">wrapper_{version}_windows_x86_64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|Win32\'">wrapper_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|Win32\'">wrapper_{version}_windows_intelx86</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'">wrapper_{version}_windows_arm64</TargetName>\n'
elif line.startswith(' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">wrapper_'):
line = f' <TargetName Condition="\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'">wrapper_{version}_windows_arm64</TargetName>\n'
if line.startswith(' <TargetVersion>'):
line = f' <TargetVersion>{version}</TargetVersion>\n'
f.write(line)

if (len(sys.argv) != 2):
Expand Down
63 changes: 61 additions & 2 deletions win_build/boinc.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup>
<Windows3rdPartyBuildDir Condition="'$(Windows3rdPartyBuildDir)' == ''">$(MSBuildThisFileDirectory)..\3rdParty\Windows</Windows3rdPartyBuildDir>
<VcpkgConfigsDir Condition="'$(VcpkgConfigsDir)' == ''">$(MSBuildThisFileDirectory)..\3rdParty\vcpkg_ports\configs\msbuild</VcpkgConfigsDir>
Expand All @@ -15,14 +42,46 @@
<CudaNvccPath Condition="'$(Platform)' == 'x64'">$(CUDA_BIN_PATH)\nvcc.exe</CudaNvccPath>
<CudaRootDir Condition="'$(CudaRootDir)|$(Platform)' == '|x64'">$(CUDA_BIN_PATH)\..\..\</CudaRootDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<IntDir>$(SolutionDir)Build\$(Platform)\$(Configuration)\$(ProjectName)\obj\</IntDir>
<OutDir>$(SolutionDir)Build\$(Platform)\$(Configuration)\</OutDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(VcpkgInstalledDir)/include/;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks Condition="'$(Configuration)' == 'Debug'">EnableFastChecks</BasicRuntimeChecks>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Fast</FloatingPointModel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization Condition="'$(Configuration)' == 'Debug'">Disabled</Optimization>
<PreprocessorDefinitions>_WIN32;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)'=='Debug'">_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)'=='Release'">_NDEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary Condition="'$(Configuration)' == 'Debug'">MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)' == 'Release'">MultiThreaded</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<Lib>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">$(VcpkgInstalledDir)/debug/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">$(VcpkgInstalledDir)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">$(VcpkgInstalledDir)/debug/lib;../../;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">$(VcpkgInstalledDir)/lib;../../;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences Condition="'$(Configuration)' == 'Release'">true</OptimizeReferences>
<ProgramDatabaseFile Condition="'$(TargetName)' == ''">$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
<ProgramDatabaseFile Condition="'$(TargetName)' != ''">$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<SetChecksum Condition="'$(Configuration)' == 'Release'">true</SetChecksum>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>$(VcpkgInstalledDir)/include/;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture>
<PreprocessorDefinitions Condition="'$(Configuration)' == 'Debug'">_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)' == 'Release'">NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
</Project>
Loading

0 comments on commit d502607

Please sign in to comment.