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

compiler given by CC/CXX is ignored by qmake

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Out of scope
    • Affects Version/s: 6.1
    • Fix Version/s: None
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Environment:
      Ubuntu 20.04 LTS

      Description

      1. Set environment variables for using clang compilers:
        qtrob@rob-desktop:/tmp/qttest$ export CC=/usr/lib/llvm-10/bin/clang
        qtrob@rob-desktop:/tmp/qttest$ export CXX=/usr/lib/llvm-10/bin/clang++
        

        No, they are not in PATH.

      2. Run configure.
        qtrob@rob-desktop:/tmp/qttest$ ~/dev/src/qtbase/configure  -prefix $PWD
        

        It will finish with:

        Once everything is built, Qt is installed. You should NOT run 'cmake --install .'
        
      3. Check config.summary for the automatically detected compiler:
        qtrob@rob-desktop:/tmp/qttest$ head -n3 config.summary 
        
        Building for: linux-clang (x86_64, CPU features: mmx sse sse2)
        Compiler: clang 10.0.0
        

        Fine!

      4. Build:
        cmake --build . --parallel
        

        Everything seems good this far.

      5. Try using qmake from this build:
        qtrob@rob-desktop:/tmp/qttest$ cd /tmp/result/
        qtrob@rob-desktop:/tmp/result$ ls -a
        .  ..
        qtrob@rob-desktop:/tmp/result$ /tmp/qttest/bin/qmake ~/dev/src/qtbase/examples/gui/analogclock/analogclock.pro
        Project ERROR: Cannot run compiler 'clang++'. Output:
        ===================
        ===================
        Maybe you forgot to setup the environment?
        

        Yes, CC and CXX are still set at this time.

      All tools from a Qt build should be usable, also when CC/CXX were used. When Qt was configured to use a certain compiler, qmake should use this.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qtbuildsystem Qt Build System Team
              Reporter:
              rlohning Robert Löhning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes