Skip to content

Commit

Permalink
[Actions] [Warning Reporting] Adding Warning Reporting to be built in…
Browse files Browse the repository at this point in the history
… Actions for Windows (#1416)

* Adding warning reporting project to be built in actions on Windows

* Adding WarningReportingCategories.cpp to the core project file

* Adding an empty define of ANNOUNCE_WARNING for warning free builds

* Adding preprocessor define in the command line

* Update Build Thunder on Windows.yml

* Trying a different project name

* Adding a folder of core

* Changing the syntax to match Windows

* Adding bridge project to be build as well to see if it builds dependences first

* Adding $(DefineConstants) to make sure we are not clearing them while adding warning reporting

* Trying to build just bridge

* Trying to build the whole solution with msbuild

* Trying a different approach with setting env variables and using devenv since it restores packages

* Building once again with devenv but setting env variable beforehand

* Changing the name to be more generic since it can be used for more things in the future

* Preparing for a pull request, cleaning everything up

* Removing variables which are no longer needed

* Adding props to enable setting the env variable in Visual Studio

* Making sure by default the macro value is empty to override the other one

* Adding a separate variable for console builds

* Using the new console variable since it was clashing with the Visual Studio one

---------

Co-authored-by: Pierre Wielders <pierre@wielders.net>
  • Loading branch information
VeithMetro and pwielders committed Dec 4, 2023
1 parent 469d6c3 commit 4dea291
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/Build Thunder on Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
comProcess: Thunder\Source\WPEProcess\comprocess.vcxproj
devEnv: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com
solution: Thunder.sln
warningReporting: Thunder\Source\extensions\warningreporting\warningreporting.vcxproj

jobs:
Thunder:
Expand Down Expand Up @@ -120,8 +121,10 @@ jobs:
shell: cmd
run: >
cd ThunderOnWindows
&& set CoreConsole="__CORE_WARNING_REPORTING__"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%bridge%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%comProcess%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%warningReporting%" "%solution%"
- name: Tar files
run: tar -czvf ${{matrix.type}}${{matrix.version}}.tar.gz artifacts
Expand Down
14 changes: 14 additions & 0 deletions Source/core/CoreDefault.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<CoreDefines />
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="CoreDefines">
<Value>$(CoreDefines)</Value>
</BuildMacro>
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions Source/core/CoreWarningReporting.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<CoreDefines>__CORE_WARNING_REPORTING__</CoreDefines>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="CoreDefines">
<Value>$(CoreDefines)</Value>
</BuildMacro>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions Source/core/WarningReportingControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

#ifndef __CORE_WARNING_REPORTING__

#define ANNOUNCE_WARNING(CATEGORY)

#define REPORT_WARNING(CATEGORY, ...)

#define REPORT_WARNING_GLOBAL(CATEGORY, ...)
Expand Down
17 changes: 13 additions & 4 deletions Source/core/core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<ClCompile Include="Thread.cpp" />
<ClCompile Include="Time.cpp" />
<ClCompile Include="Trace.cpp" />
<ClCompile Include="WarningReportingCategories.cpp" />
<ClCompile Include="WarningReportingControl.cpp" />
<ClCompile Include="WorkerPool.cpp" />
<ClCompile Include="XGetopt.cpp" />
Expand Down Expand Up @@ -179,15 +180,23 @@
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="CoreWarningReporting.props" />
<Import Project="CoreDefault.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="CoreWarningReporting.props" />
<Import Project="CoreDefault.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="CoreWarningReporting.props" />
<Import Project="CoreDefault.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="CoreWarningReporting.props" />
<Import Project="CoreDefault.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -216,7 +225,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<PreprocessorDefinitions>$(CoreConsole);$(CoreDefines);CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
Expand All @@ -235,7 +244,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>$(CoreConsole);$(CoreDefines);CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(WindowsPath)</AdditionalIncludeDirectories>
<UseStandardPreprocessor>true</UseStandardPreprocessor>
Expand All @@ -255,7 +264,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;IN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>$(CoreConsole);$(CoreDefines);CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;IN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
Expand All @@ -278,7 +287,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>$(CoreConsole);$(CoreDefines);CORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
Expand Down
3 changes: 3 additions & 0 deletions Source/core/core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -365,5 +365,8 @@
<ClCompile Include="Module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WarningReportingCategories.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

0 comments on commit 4dea291

Please sign in to comment.