nokotan / VSExtForEmscripten

emcc support for Visual Studio 2017, 2019, 2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precompiled header

vautieri opened this issue · comments

Would it be possible to support the precompiled header flag? I don't see it as an option when copying settings from an existing project.

To add more detail:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(395,5): error MSB4096: The item "......" in item list "ClCompile" does not define a value for metadata "PrecompiledHeaderFile". In order to use this metadata, either qualify it by specifying %(ClCompile.PrecompiledHeaderFile), or ensure that all items in this list define a value for this metadata.

which is coming from Microsoft.CppCommon.targets

  <!-- Check if any compile could run at the same time as the PCH. -->
  <_PCHForceSyncWrite Condition="'%(ClCompile.PrecompiledHeader)' == 'NotUsing' or '%(ClCompile.PrecompiledHeader)' == ''">true</_PCHForceSyncWrite>
</PropertyGroup>

"Microsoft.Cpp.Clang.targets" has the good implementation for this, I had just pasted some corresponding parts into "Toolset.targets".
After installing v0.4.1, "Precompiled Headers" pages will appear and you will be able to use precompiled headers, please try in your develop environment.

_PCHForceSyncWrite has no effect in Visual Studio 2022, Version 17.2.2. It does not work around the problem that some compiler instances get no access to several *.pch files in the solution as soon as property UseMultiToolTask is set to true. So the latter - and with it the associated properties EnforceProcessCountAcrossBuilds and MultiProcMaxCount are entirely useless.