GENie icon indicating copy to clipboard operation
GENie copied to clipboard

exclude from Unity Build option (VS2019)

Open DJLink opened this issue 5 years ago • 2 comments

With Unity(Jumbo) builds support in VS2019 out of the box there's also a new option to exclude files from those builds, still present for compiling but excluded from the Jumbo build and compiled the "regular" way to avoid name clashes etc. This can happen with some third party libs, ran into that issue with IMGui for example. Excluding from Unity does the trick,

The option is in the item properties and the tag is similar to the exclude build.

<ClCompile Include="..\..\imgui\examples\imgui_impl_opengl3.cpp">
      <IncludeInUnityFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</IncludeInUnityFile>
</ClCompile>

For comparison the exclude from build

<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>

I was researching into adding this to GENie myself but wanted to discuss the least intrusive way of doing so if possible. Thanks

image

DJLink avatar Aug 01 '19 07:08 DJLink

@rhoot Might have opinion about this one.

bkaradzic avatar Aug 01 '19 15:08 bkaradzic

It'd probably be good to support the feature in its entirety, rather than picking out individual properties to add. If it helps someone get a jump on it, here are all the related vcxproj elements, with their default values:

In the project's "Configuration" PropertyGroup block:

<EnableUnitySupport>true</EnableUnitySupport>

In the project's or each file's ClCompile block:

<IncludeInUnityFile>true</IncludeInUnityFile>
<OrderInUnityFile>100</OrderInUnityFile>
<CombineFilesOnlyFromTheSameFolder>false</CombineFilesOnlyFromTheSameFolder>
<MinFilesInUnityFile>2</MinFilesInUnityFile>
<MaxFilesInUnityFile>0</MaxFilesInUnityFile>
<MinUnityFiles>1</MinUnityFiles>
<AddCodeBeforeSourceInclude></AddCodeBeforeSourceInclude>
<AddCodeAfterSourceInclude></AddCodeAfterSourceInclude>
<AddCodeBeforeSourceIncludeFromFile></AddCodeBeforeSourceIncludeFromFile>
<AddCodeAfterSourceIncludeFromFile></AddCodeAfterSourceIncludeFromFile>
<UnityFilesDirectory>$(IntDir)</UnityFilesDirectory>
<CustomUnityFile>false</CustomUnityFile>

fitzymj avatar Aug 05 '19 01:08 fitzymj