winflexbison icon indicating copy to clipboard operation
winflexbison copied to clipboard

Visual Studio dependencies and the provided CustomBuildRules

Open ArcaneTourist opened this issue 4 years ago • 4 comments

Leaving this here for now, but please see update.

Many thanks for this project!

Maybe the CustomBuildRules instructions need an update for allowing compiling based on dependency timestamp handling?

This is the first time I'm using winflexbison or Visual Studio (I mostly do linux/unix), so perhaps I'm missing something, but I was surprised that VS only half-way handled dependencies for the bison outputs:

I was having an issue in Visual Studio 2019. VS would run bison if the *.tab.* files did not exist, but would not run bison if the *.y bison file had been changed. The issue turned out that the *.tab.* files (and all other source/header files) by default had a property of properties/general/exclude-from-build. Setting that property to "no" caused VS to understand that it needed to run bison whenever the *.y file changed (and also invoke the compiler for the *.tab.cpp and other source files).

I don't know if default exclude-from-build=yes is a recent change to VS, or if I somehow unexpectedly changed the stock defaults, or if the bison/flex rules could be updated to somehow set exclude-from-build=no when adding the *.tab.* files to a project. If this is normal VS behavior and the custom rules can't help with the exclude-from-build settings, then I suggest the instructions on the CustomBuildRules be updated to advise people to reset the exclude-from-build property when adding the *.tab.* files to a project.

ArcaneTourist avatar Jun 22 '21 15:06 ArcaneTourist

OK.... The original issue report is all wrong. But, I don't know what the heck is going on. VS is intermittently ignoring my updates to the *.y file even when nothing else changes and regardless of the settings of exclude-from-build. I really can't imagine how that is happening, but if someone has a clue, I'd love to hear it.

ArcaneTourist avatar Jun 22 '21 17:06 ArcaneTourist

I will try to reproduce your problem and get back to you with possible solution.

lexxmark avatar Jun 24 '21 06:06 lexxmark

I have created a new project, added win_flex_bison custom build rules and added some *.y file to project.

There is an empty ExcludeFromBuild option there by default and I was able to successfully build 1.y and then added 1.tab.cpp/h files and after that any change in 1.y leads to rebuilding 1.y and thus regenerating 1.tab.cpp/h files.

image

lexxmark avatar Jun 30 '21 04:06 lexxmark