Nominate our 2022 Qt Champions!

[solved] passing arguments to the compiler

  • I'm optimizing the performance of a small program, and someone in another forum suggested that I use SSE4.1. I've checked my compiler, and it appears to have support for this, but I need to send it a flag:

    @Support for SSE4.1 built-in functions and code generation are available via -msse4.1.
    Support for SSE4.2 built-in functions and code generation are available via -msse4.2.@

    My first thought was to use the variable QMAKE_CXXFLAGS_DEBUG in my .pro file, but according to the documentation:

    bq. This variable contains the C++ compiler flags for creating a debuggable application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

    So, I interpret that to mean I'm going about this the wrong way. Can someone edify me?


  • QMAKE_CXXFLAGS[_DEBUG|_RELEASE] is exactly what you need. Documentation says that you rare need to modify them but sometimes you are.

  • OK, thank you. Marked as solved.

Log in to reply