Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dependency order for output from bison & flex in pro file not working.
Forum Updated to NodeBB v4.3 + New Features

Dependency order for output from bison & flex in pro file not working.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 424 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • idlefrogI Offline
    idlefrogI Offline
    idlefrog
    wrote on last edited by idlefrog
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you doing something similar to what is shown here ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • idlefrogI Offline
        idlefrogI Offline
        idlefrog
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • idlefrogI Offline
          idlefrogI Offline
          idlefrog
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Could you provide a minimal example that shows that issue ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved