6

How is it possible to specify the compiler flags for a single source file using QMake .pro file?

Tibor Takács
  • 3,535
  • 1
  • 20
  • 23
  • You can find the detail [in this document](https://doc-snapshots.qt.io/qt5-5.4/qmake-advanced-usage.html#adding-compilers) – BEPP Jul 30 '15 at 12:43
  • If possible avoid different flags for different files. At least use same optimization "solution" wise and same warnings "project" wise. – CoffeDeveloper Jul 30 '15 at 13:00
  • Is it possible to mit RTTI flag? – Tibor Takács Jul 30 '15 at 13:32
  • 2
    Possible duplicate of [How to specify compiler flag to a single source file with qmake?](https://stackoverflow.com/questions/27683777/how-to-specify-compiler-flag-to-a-single-source-file-with-qmake) – timday Jul 13 '17 at 08:36

1 Answers1

-2

Avoid using different flags for different files in a single build!

You should always find a baseline which works across the board. Mixing flags can cause complications when invalid code from one file interferes with perspectively valid code from another, etc. These files are being built together and therefore they need to be compiled together and uniformly.

Connor Spangler
  • 805
  • 2
  • 12
  • 29
  • 1
    I agree with you, it would be only a temporary solution. But it would be necessary to solve it. And I am also interested in that :). – Tibor Takács Jul 31 '15 at 11:56