Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Dependencies when using QMAKE_EXTRA_COMPILERS for code generation

Dependencies when using QMAKE_EXTRA_COMPILERS for code generation

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 372 Views
  • 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.
  • G Offline
    G Offline
    GusReid
    wrote on last edited by
    #1

    I've been using the qmake project from here https://www.qt.io/blog/2018/06/06/building-bridge-qt-dds as a base for building our somewhat complex DDS based application library, and have run into a problem with multicore builds. My issue is that some of the IDLs used include others. This produces a dependency downstream where some of the resulting generated headers #include others. For single processor builds, this works fine; I just order the IDLs in the .pro file such that the included headers are already generated by the time we get to the headers that include them. However, for running parallel builds, I've been unable to find a way to prevent one header from including another that may not have finished generating by the time we get there. That puts a limit on the number of cores I can use for a build.

    Is there a way to improve the dependency management in this example to cover this case? Failing that, is there a way to limit the number of cores passed to make's -j param in an individual .pro file so I can prevent this issue for IDL generation without slowing down the rest of our build? Or can I somehow force the IDL generation step to complete before the gcc part begins?

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

      Hi and welcome to devnet,

      One idea that comes to mind is to use the subdirs template so you can properly order things. Have one project dedicated to the generation of your IDL related files. Make it a dependency of your main project and so your main project will begin building after everything is generated.

      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
      1
      • G Offline
        G Offline
        GusReid
        wrote on last edited by GusReid
        #3

        Thanks for the reply, that makes sense. I could write a second project file that knows the names of all the generated files it's expecting to see (though it'd warn that they don't exist when qmake generates the makefile from it), and builds them, but I don't see how to have the gcc compile step not run against the output in the existing project. Apologies if it's a stupid question, but how would I turn that off in the generation project?

        [EDIT] I figured it out. TEMPLATE = aux, and remove the ddsgen.variable_out line from each extra compiler definition. I think that's it working. Thanks for the help!

        [EDIT] However, qmake is warning that it can't find the input files for the second, build, project since they don't exist when qmake is run to create the Makefiles for it. Is there any way to suppress that warning?

        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