Dependency order for output from bison & flex in pro file not working.
-
I am trying to get my flex/bison to run before the build starts.
However, the outputs from flex are generated after they are needed, and then of course my build fails!I did think that all I needed was to specify:
flex.CONFIG += target_predeps
to make the flex run BEFORE the build.Here's my flex setup (in my .pro file):
flex.name = Flex ${QMAKE_FILE_IN} flex.input = FLEXSOURCES flex.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp flex.commands = flex -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} flex.CONFIG += target_predeps flex.variable_out = GENERATED_SOURCES silent:flex.commands = @echo Lex ${QMAKE_FILE_NAME} && $$flex.commands QMAKE_EXTRA_COMPILERS += flex
Is there another configuration parameter I need to set to get the dependency order correct?
-
@SGaist Yes. Thanks for the link :)
Basically I'm generating a few files that are processed by flex, and then included later as header files. But my builds only sometimes work. It's the same problem with Qt4.8/Qt5.
Although to be honest, I know very little about flex/bison, other than they are compilers/scanners.
Your help is appreciated as always :)
... Will look over the example you sent, and see if there's anything different compared to my setup. -
@SGaist I've tried to get the bison/flex 'compilers' to run before the build with the code example, but it seems to be ignored. I notice the example says it works with only one file per 'pro' file, but I have multiple files. So I had the 'depends' set to multiple targets.
Even trying to add a single dependency didn't work either. I'm starting to suspect that this is a qmake bug.
Looking online, there's very little mentioned about how to properly integrate bison/flex into a pro file, although it seems easier with a plain old Makefile. -
Could you provide a minimal example that shows that issue ?