Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85877

Handle CONFIG += thread (aka Threads::Threads)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.0
    • Build System: CMake

    Description

      We have a bunch of hardcoded find_package(Threads) + target_link_libraries(Threads::Threads) across multiple repos in different projects, to ensure linking works on Linux (mostly) by adding the -lpthread flag.

      In qmake this is handled at the public mkspec level by loading qt.prf that does CONFIG += thread, and thread.prf adds the various flags in QMAKE_CFLAGS_THREAD, etc.

      qt.prf is loaded both when building qt apps, as well as Qt itself. The CMake equivalent is the Qt6::Platform target.

      We need to do the same, and remove all the hardcoded calls. This in turn ensure the proper -lpthread flag is added to the .prl files, so that qmake apps continue to work on Linux.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-85877
          # Subject Branch Project Status CR V

          Activity

            People

              alexandru.croitor Alexandru Croitor
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: