Skip to content

Commit

Permalink
chore: Release 配置下定义 WINRT_NO_SOURCE_LOCATION 以减小包的体积
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Nov 13, 2023
1 parent d9ca118 commit a9196e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Common.Post.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- WINRT_NO_SOURCE_LOCATION: VS 2022 17.6 开始 <source_location> 返回完全限定函数名,使 cppwinrt 中大量的模板函数无法 COMDAT 折叠, -->
<!-- 从而大幅增加了二进制文件的体积。定义 WINRT_NO_SOURCE_LOCATION 以禁止 cppwinrt 使用 <source_location>。这是一个临时解决方案,在未来 -->
<!-- 我们应定义 _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION=0 恢复 <source_location> 的旧行为,因为它也让日志文件多了很多废话。 -->
<PreprocessorDefinitions>NDEBUG;WINRT_NO_SOURCE_LOCATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
Expand Down

0 comments on commit a9196e8

Please sign in to comment.