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. How does Qt Creator compose the invocation of gcc/g++?
QtWS25 Last Chance

How does Qt Creator compose the invocation of gcc/g++?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qtcreator 4.5.2qmakeg++
5 Posts 2 Posters 371 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.
  • J Offline
    J Offline
    JeKK666
    wrote on 14 Oct 2024, 11:33 last edited by JeKK666
    #1

    Cross compiling an app for arm in Qt 5.15 with Qt Creator 4.5.2, i am trying to remove the -O2 optimization flag from the relase build g++ call; i need to remove it as i want to test a build using -Ofast instead, but the problem is that my flag gets inserted before the already present one and is therefore ignored.
    I have checked all the Environment variables set for my project build, and removed "-O2" from all those which contained it; the variables which used to contain the flag are the following:
    CXXFLAGS
    QMAKE_CXXFLAGS
    OE_QMAKE_CXXFLAGS

    I have also added the following to my project file

    QMAKE_CXXFLAGS -= -O2
    QMAKE_CXXFLAGS += -Ofast
    

    and i can see the -Ofast flag is added to the compiler call, which follows

    arm-poky-linux-gnueabi-g++  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi -c -pipe --sysroot=/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi -Ofast -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DQT_NO_DEBUG -DQT_PDFWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_PDF_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -I. -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtPdfWidgets -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtWidgets -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtPdf -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtGui -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtSerialPort -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/include/QtCore -I. -I. -I/opt/eng-imx-fb/5.10-gatesgarth/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi/usr/lib/mkspecs/linux-oe-g++ -o main.o main.cpp
    

    I couldn't find in the Qt Creator documentation how is this call to g++ created, for instance i also don't understand where all the includes are specified, as there is no environment variable associated to them, just this line

    QT += core gui widgets serialport pdfwidgets
    

    at the top of the project file.

    Can anyone point me to the relvant docs, if such exist, or provide clues on where to look next?

    Still haven't learned Lambdas...

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 14 Oct 2024, 14:12 last edited by
      #2

      This has nothing to do with QtCreator but with your build system (qmake in your case). All qmake vvariables can be found here: https://doc.qt.io/qt-6/qmake-variable-reference.html

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

      J 1 Reply Last reply 14 Oct 2024, 14:59
      2
      • C Christian Ehrlicher
        14 Oct 2024, 14:12

        This has nothing to do with QtCreator but with your build system (qmake in your case). All qmake vvariables can be found here: https://doc.qt.io/qt-6/qmake-variable-reference.html

        J Offline
        J Offline
        JeKK666
        wrote on 14 Oct 2024, 14:59 last edited by
        #3

        @Christian-Ehrlicher Thanks! I was able to solve my issue with this.
        As you may have guessed, i am not completely aware of what goes on behind the scense with this IDE, and also not very familiar with make/cmake/qmake in general.

        Still haven't learned Lambdas...

        1 Reply Last reply
        0
        • J JeKK666 has marked this topic as solved on 14 Oct 2024, 14:59
        • J Offline
          J Offline
          JeKK666
          wrote on 14 Oct 2024, 15:05 last edited by
          #4

          @Christian-Ehrlicher Albeit i was able to solved the specific issue i was having, is there a way to determine what the call to the compiler will look like?
          Can i find this somewhere in the IDE, or the compiler call is simply a result of what qmake does when parsing the .pro file?

          Still haven't learned Lambdas...

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 14 Oct 2024, 15:23 last edited by
            #5

            You can take a look into the generated Makefile

            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
            1

            1/5

            14 Oct 2024, 11:33

            • Login

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