Skip to content

Commit

Permalink
Reduce MRM.dll binary size by 37 KB by disabling RTTI. (#904)
Browse files Browse the repository at this point in the history
* MRTCore: Reduce DLL size by disabling RTTI.
  • Loading branch information
jefgen authored and DrusTheAxe committed Jun 14, 2021
1 parent c9d6d29 commit c593005
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
28 changes: 7 additions & 21 deletions dev/MRTCore/mrt/Core/src/MRM.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,25 @@
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<!-- Shared settings for all Configurations and Platforms -->
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;STANDALONEDLL_EXPORTS;UNICODE;_UNICODE;DOWNLEVEL_PRIOR_TO_WIN8;WIL_SUPPRESS_PRIVATE_API_USE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalIncludeDirectories>..\..\mrm\include</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
<!-- MRT Core doesn't use RTTI. -->
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<Link>
<AdditionalDependencies>$(OutDir)..\mrmmin\mrmmin.lib;rpcrt4.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>MRM.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
Expand Down Expand Up @@ -137,31 +144,10 @@
<!-- EnableCOMDATFolding and OptimizeReferences are set to true below for all build configurations. -->
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Guard</ControlFlowGuard>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Guard</ControlFlowGuard>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<Link>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ClCompile>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Guard</ControlFlowGuard>
</ClCompile>
<ClCompile>
<ControlFlowGuard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Guard</ControlFlowGuard>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="MRM.cpp" />
Expand Down
7 changes: 7 additions & 0 deletions dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<!-- Shared settings for all Configurations and Platforms -->
<ItemDefinitionGroup>
<ClCompile>
<!-- MRT Core doesn't use RTTI. -->
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<!-- Shared settings for all Configurations and Platforms -->
<ItemDefinitionGroup>
<ClCompile>
<!-- MRT Core doesn't use RTTI. -->
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
Expand Down

0 comments on commit c593005

Please sign in to comment.