• 13
• 14
• 27
• 9
• 9

VS2013 .hlsl file causes constant rebuild

This topic is 1267 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I've noticed in a small library I have that everytime I do a build in VS Express 2013, even when the project is up to date, it would constantly rebuild.  Now it wouldn't rebuild any particular file, it just kept rebuilding the final output.  It was a minor but still annoying issue.  So after playing around with it a while I noticed that removing any .hlsl files from the project caused it to build normally (ie. only rebuild if necessary).  The funny part is the .hlsl files did nothing.  They were just 'header' .hlsl files with some common functions I often used when writing shaders, but didn't actually contribute in any way to the final output.  They were set as 'exclude from build', and had no outputs (ie. no header file name, no object file name, no assembly file name) so as to ensure there was no output of any kind.  Yet just their presence caused VS to rebuild everytime I did a build.

Is this a known bug?  Google yielded nothing remotely of interest in this.  Should I report this somewhere?  Is there something missing or an easy work around?

Share on other sites
Go to Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild output verbosity and set it to "detailed" (or do that for the log file if you prefer). Then VS will spit out tons of information when it builds, including the reasons it thinks it needs to do a build. Shift through the output and you should find an answer as to what you're doing wrong.

Share on other sites

I did what you suggested.  Is there something I should be looking for in particular?  Nothing obvious stands out.  The lines that seem to pertain to .hlsl files are:

1>Done building target "MakeDirsForFxc" in project "GameLib.vcxproj".
1>Target "FxCompile" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets" from project "D:\Programming\GameLib\GameLib.vcxproj" (target "_BuildGenerateSourcesAction" depends on it):
1>Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true') was evaluated as ('Clipping.hlsl' != '' and 'true'!='true').
1>Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true') was evaluated as ('Fixed.hlsl' != '' and 'true'!='true').
1>Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true') was evaluated as ('Interpolate.hlsl' != '' and 'true'!='true').
1>Task "FXC" skipped, due to false condition; ('@(FxCompile)' != '' and '%(FxCompile.ExcludedFromBuild)'!='true') was evaluated as ('Quaternion.hlsl' != '' and 'true'!='true').
1>Done building target "FxCompile" in project "GameLib.vcxproj".
1>Target "_SelectedFiles" skipped. Previously built successfully.


I'm not sure what that's telling me though other than those files were skipped (as intended) and why that would (could?) be causing the unnecessary recompiles.

Share on other sites

I ran into the same problem. The problem "went away" (so far) when I changed the files from "Excluded From Build" to Item type->"Does not participate in build." Perhaps that will work for you. Just FYI, if it makes a difference, I have my fx, ps, vs, etc. in a solution filter group, rather than among Header or Source files.

Edited by Buckeye

Share on other sites

I ran into the same problem. The problem "went away" (so far) when I changed the files from "Excluded From Build" to Item type->"Does not participate in build." Perhaps that will work for you. Just FYI, if it makes a difference, I have my fx, ps, vs, etc. in a solution filter group, rather than among Header or Source files.

I ended up doing the same thing :)  I guess I phrased the question wrong, I was more interested if this was a known bug and if I should report this somewhere.

Share on other sites

I was more interested if this was a known bug and if I should report this somewhere.

As you found, google and connect.microsoft.com don't find anything. You can post something on connect.microsoft.com.