Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude from Unity Build option (VS2019) #466

Open
DJLink opened this issue Aug 1, 2019 · 2 comments
Open

exclude from Unity Build option (VS2019) #466

DJLink opened this issue Aug 1, 2019 · 2 comments

Comments

@DJLink
Copy link
Contributor

DJLink commented Aug 1, 2019

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

@bkaradzic
Copy link
Owner

@rhoot Might have opinion about this one.

@fitzymj
Copy link
Contributor

fitzymj commented Aug 5, 2019

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@DJLink @bkaradzic @fitzymj and others