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

Select SDK and XCode for Build Qt from sources with MacOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.15.0
    • Build System
    • None
    • macOS

    Description

      Hi,

      I'm attempting to build Qt 5.15 from sources for macOS using a compiler and (macOS) SDK located in a custom location, i.e. not the default installed on the system. The toolchain and SDK to use are located in the directory /MyCustomLocation/toolchains/x64-macos/Toolchains/<Xcode version>/usr/bin/clang and /MyCustomLocation/toolchains/x64-macos/SDKs/<macOS SDK>. To do this I create a custom platform file generic-macos-qmake.conf.in that sets various qmake variables, e.g. QMAKE_CC, QMAKE_CXX, etc.. I then configure Qt with the following command line:

      configure -release -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -no-xcb -skip qtandroidextras -skip qtconnectivity -skip qtpurchasing -skip qtwayland -c+std c+14 -ssl -securetransport -sdk /MyCustomLocation/toolchains/x64-macos/SDKs/MacOSX10.15.sdk -webengine-pepper-plugins -webengine-printing-and-pdf -xplatform generic-macos-qmake.conf.in

      This worked for previous versions of Qt 5.x, but fails with Qt 5.15, as qmake insists on using the system's compiler under /Applications/Xcode.app and ignores the settings in the platform file. Is it possible to tell the Qt build system which compiler and SDK to use, or must I stuck with the default compiler on the system ?

      I really need to be able to select which compiler to use to build Qt 5.15, and using xcode-select to select different Xcode versions doesn't really scale in a multiuser environment.

      Greetings,
      Thomas

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            lamb Thomas Lämmlein
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes