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. Source files compiled multiple times with Qt Test
QtWS25 Last Chance

Source files compiled multiple times with Qt Test

Scheduled Pinned Locked Moved Solved General and Desktop
testqtestlibqtest
3 Posts 2 Posters 631 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.
  • M Offline
    M Offline
    Maluna34
    wrote on 19 Feb 2019, 10:43 last edited by Maluna34
    #1

    Hello !

    I noticed that when I use Qt test in my project, so when I have the main project, containing the app project and the test project, the source files used in both are built twice (even if they are located at the same place on the disk).

    Project/
        |----- App/
                 |----- foo.cpp
        |----- Tests/
                 |----- project/app/foo.cpp
    

    Here foo.cpp is built twice.
    Is the only solution to use a third DLL project building only once these common files or is there an option to share object files between project ?

    Thanks for your help !

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 19 Feb 2019, 12:29 last edited by
      #2

      Since the source file can be compiled with different compiler options I don't see a chance other than creating a shared lib - qmake simply can't know if the generated object file is compiled with the same options (at least not that easy that it's worth the trouble).

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • M Offline
        M Offline
        Maluna34
        wrote on 19 Feb 2019, 13:24 last edited by
        #3

        Oh yes, it's logic. Thanks !!!

        1 Reply Last reply
        0

        2/3

        19 Feb 2019, 12:29

        • Login

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