How to specify compiler flag to a single source file with qmake?
问题 While other source files use the default flags? Some of my source files need some extra C++ preprocessor defines. I use Qt 5. I only found QMAKE_CXXFLAGS is for global use in qmake projects. 回答1: This is what used to be done in theory for GUI painting in the Qt source itself: SOURCES_NOOPTIMIZE = somefile.cpp nooptimize.name = nooptimize nooptimize.input = SOURCES_NOOPTIMIZE nooptimize.dependency_type = TYPE_C nooptimize.variable_out = OBJECTS nooptimize.output = ${QMAKE_VAR_OBJECTS_DIR}$