Skip to content

Commit cdfa149

Browse files
authored
clang-cl (#51)
Adding clang-cl to solution and fixing warnings
1 parent 8caabb1 commit cdfa149

File tree

5 files changed

+75
-8
lines changed

5 files changed

+75
-8
lines changed

.github/workflows/msbuild-latest.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ env:
1515
# Path to the solution file relative to the root of the project.
1616
SOLUTION_FILE_PATH: Ancient.sln
1717

18-
# Configuration type to build.
19-
# You can convert this to a build matrix if you need coverage of multiple configuration types.
20-
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21-
BUILD_CONFIGURATION: Release
22-
2318
permissions:
2419
contents: read
2520

2621
jobs:
2722
build:
23+
strategy:
24+
matrix:
25+
build_configuration: [Release, Release_Clang]
2826
runs-on: windows-latest
2927

3028
steps:
@@ -41,4 +39,4 @@ jobs:
4139
working-directory: ${{env.GITHUB_WORKSPACE}}
4240
# Add additional options to the MSBuild command line here (like platform or verbosity level).
4341
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
44-
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
42+
run: msbuild /m /p:Configuration=${{matrix.build_configuration}} ${{env.SOLUTION_FILE_PATH}}

Ancient.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|x64 = Debug|x64
1111
Debug|x86 = Debug|x86
12+
Release_Clang|x64 = Release_Clang|x64
13+
Release_Clang|x86 = Release_Clang|x86
1214
Release|x64 = Release|x64
1315
Release|x86 = Release|x86
1416
EndGlobalSection
@@ -17,6 +19,10 @@ Global
1719
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Debug|x64.Build.0 = Debug|x64
1820
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Debug|x86.ActiveCfg = Debug|Win32
1921
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Debug|x86.Build.0 = Debug|Win32
22+
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release_Clang|x64.ActiveCfg = Release_Clang|x64
23+
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release_Clang|x64.Build.0 = Release_Clang|x64
24+
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release_Clang|x86.ActiveCfg = Release_Clang|Win32
25+
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release_Clang|x86.Build.0 = Release_Clang|Win32
2026
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release|x64.ActiveCfg = Release|x64
2127
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release|x64.Build.0 = Release|x64
2228
{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}.Release|x86.ActiveCfg = Release|Win32

Ancient.vcxproj

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
<Configuration>Debug</Configuration>
66
<Platform>Win32</Platform>
77
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release_Clang|Win32">
9+
<Configuration>Release_Clang</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release_Clang|x64">
13+
<Configuration>Release_Clang</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
816
<ProjectConfiguration Include="Release|Win32">
917
<Configuration>Release</Configuration>
1018
<Platform>Win32</Platform>
@@ -22,6 +30,7 @@
2230
<VCProjectVersion>17.0</VCProjectVersion>
2331
<ProjectGuid>{9EA0A49E-A5DB-4A8A-B63D-FED0ACD8E059}</ProjectGuid>
2432
<Keyword>Win32Proj</Keyword>
33+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2534
</PropertyGroup>
2635
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2736
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -34,6 +43,11 @@
3443
<UseDebugLibraries>false</UseDebugLibraries>
3544
<PlatformToolset>v143</PlatformToolset>
3645
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|Win32'" Label="Configuration">
47+
<ConfigurationType>Application</ConfigurationType>
48+
<UseDebugLibraries>false</UseDebugLibraries>
49+
<PlatformToolset>ClangCL</PlatformToolset>
50+
</PropertyGroup>
3751
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
3852
<ConfigurationType>Application</ConfigurationType>
3953
<UseDebugLibraries>true</UseDebugLibraries>
@@ -44,6 +58,11 @@
4458
<UseDebugLibraries>false</UseDebugLibraries>
4559
<PlatformToolset>v143</PlatformToolset>
4660
</PropertyGroup>
61+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|x64'" Label="Configuration">
62+
<ConfigurationType>Application</ConfigurationType>
63+
<UseDebugLibraries>false</UseDebugLibraries>
64+
<PlatformToolset>ClangCL</PlatformToolset>
65+
</PropertyGroup>
4766
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4867
<ImportGroup Label="ExtensionSettings">
4968
</ImportGroup>
@@ -55,12 +74,18 @@
5574
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
5675
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
5776
</ImportGroup>
77+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|Win32'" Label="PropertySheets">
78+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79+
</ImportGroup>
5880
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
5981
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6082
</ImportGroup>
6183
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
6284
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6385
</ImportGroup>
86+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|x64'" Label="PropertySheets">
87+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
88+
</ImportGroup>
6489
<PropertyGroup Label="UserMacros" />
6590
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
6691
<LinkIncremental>false</LinkIncremental>
@@ -71,9 +96,15 @@
7196
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7297
<LinkIncremental>false</LinkIncremental>
7398
</PropertyGroup>
99+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|Win32'">
100+
<LinkIncremental>false</LinkIncremental>
101+
</PropertyGroup>
74102
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
75103
<LinkIncremental>false</LinkIncremental>
76104
</PropertyGroup>
105+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|x64'">
106+
<LinkIncremental>false</LinkIncremental>
107+
</PropertyGroup>
77108
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78109
<ClCompile>
79110
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -118,6 +149,22 @@
118149
<OptimizeReferences>true</OptimizeReferences>
119150
</Link>
120151
</ItemDefinitionGroup>
152+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|Win32'">
153+
<ClCompile>
154+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
155+
<WarningLevel>Level3</WarningLevel>
156+
<LanguageStandard>stdcpp17</LanguageStandard>
157+
<AdditionalIncludeDirectories>api;api/ancient</AdditionalIncludeDirectories>
158+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
159+
<TreatWarningAsError>true</TreatWarningAsError>
160+
</ClCompile>
161+
<Link>
162+
<GenerateDebugInformation>true</GenerateDebugInformation>
163+
<SubSystem>Console</SubSystem>
164+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
165+
<OptimizeReferences>true</OptimizeReferences>
166+
</Link>
167+
</ItemDefinitionGroup>
121168
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
122169
<ClCompile>
123170
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +181,22 @@
134181
<OptimizeReferences>true</OptimizeReferences>
135182
</Link>
136183
</ItemDefinitionGroup>
184+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Clang|x64'">
185+
<ClCompile>
186+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
187+
<WarningLevel>Level3</WarningLevel>
188+
<LanguageStandard>stdcpp17</LanguageStandard>
189+
<AdditionalIncludeDirectories>api;api/ancient</AdditionalIncludeDirectories>
190+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
191+
<TreatWarningAsError>true</TreatWarningAsError>
192+
</ClCompile>
193+
<Link>
194+
<GenerateDebugInformation>true</GenerateDebugInformation>
195+
<SubSystem>Console</SubSystem>
196+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
197+
<OptimizeReferences>true</OptimizeReferences>
198+
</Link>
199+
</ItemDefinitionGroup>
137200
<ItemGroup>
138201
<ClCompile Include="main.cpp" />
139202
<ClCompile Include="src\ACCADecompressor.cpp" />

src/common/MemoryBuffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MemoryBuffer : public Buffer
1515
public:
1616
MemoryBuffer(size_t size);
1717
MemoryBuffer(const Buffer &src,size_t offset,size_t size);
18-
virtual ~MemoryBuffer() override final;
18+
~MemoryBuffer();
1919

2020
virtual const uint8_t *data() const noexcept override final;
2121
virtual uint8_t *data() override final;

src/common/WrappedVectorBuffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WrappedVectorBuffer : public Buffer
1717
{
1818
public:
1919
WrappedVectorBuffer(std::vector<uint8_t> &refdata);
20-
virtual ~WrappedVectorBuffer() override final;
20+
~WrappedVectorBuffer();
2121

2222
virtual const uint8_t *data() const noexcept override final;
2323
virtual uint8_t *data() override final;

0 commit comments

Comments
 (0)