Qmake: how to remove compiler flag for a certain project, without changing qmake.conf?
The only way this could work is
QMAKE_CFLAGS -= /GL /O2
but I doubt this works for QMAKE_CFLAGS
.
Alternatively, you could redefine QMAKE_CFLAGS
, forgetting its previous value:
QMAKE_CFLAGS = $$CFLAGS_WITHOUT_GL_O2
How to remove alter default CFLAGS in qmake?
I succeed removing all flags using those commands:
QMAKE_CXXFLAGS_RELEASE = -Wall -pedantic -fPIC
QMAKE_CFLAGS_RELEASE = -Wall -pedantic -fPIC
How to change qmake release flags for gcc? (Change -O2 to -Os)
You can change global compiler flags by modifying QMAKE_CXXFLAGS
. Compiler flags for debug and release builds can be set in QMAKE_CXXFLAGS_DEBUG
and QMAKE_CXXFLAGS_RELEASE
respectively.
For your concrete example, you should do something like this:
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -Os
Can qmake configure command line options in a Visual Studio project?
Try with QMAKE_CXXFLAGS
:
QMAKE_CXXFLAGS += /MP
It seems to be working - setting that and running qmake -tp vc
sets the MP flag in compiler's options.
qmake configuration
Does it help when you add exceptions
and rtti
to your CONFIG
variable?
CONFIG += exceptions rtti
You should probably make sure that your custom Qt build has exception and rtti support enabled:
configure.exe -exceptions -rtti [...]
Related Topics
How to Call a Pointer-To-Member-Function
How to Generate a Newline in a Cpp MACro
Best Bignum Library to Solve Project Euler Problems in C++
Difference Between | and || , or & and &&
Why Does Pointer to Int Convert to Void* But Pointer to Function Convert to Bool
Open File with Fopen, Given Absolute Path on Windows
Why Do We Need to Tie Std::Cin and Std::Cout
Get Std::Fstream Failure Error Messages And/Or Exceptions
Equivalent of "Using Namespace X" for Scoped Enumerations
How Copy from One Stringstream Object to Another in C++
Incomplete Class Usage in Template
Inconsistent Strcmp() Return Value When Passing Strings as Pointers or as Literals
Why Doesn't the C++11 'Auto' Keyword Work for Static Members