Hello. To illustrate the issue I'm facing, I created the following simple project:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += precompile_header
PRECOMPILED_HEADER = testpch.h
QMAKE_CC = $${QMAKE_CXX}
QMAKE_CFLAGS += -TP
QMAKE_CFLAGS += -EHsc
SOURCES += \
main.cpp \
extra.c
HEADERS += testpch.h
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += precompile_header
PRECOMPILED_HEADER = testpch.h
QMAKE_CC = $${QMAKE_CXX}
QMAKE_CFLAGS += -TP
QMAKE_CFLAGS += -EHsc
SOURCES += \
main.cpp \
extra.c
HEADERS += testpch.h
To copy to clipboard, switch view to plain text mode
The problem is that extra.c is not compiled with the precompiled header, even though it is compiled as a C++ file. main.cpp has in its command line
-FItestpch.h -Yutestpch.h -Fpdebug\testproject_pch.pch
-FItestpch.h -Yutestpch.h -Fpdebug\testproject_pch.pch
To copy to clipboard, switch view to plain text mode
, which is not present in the command line for extra.c. How can I determine qmake to introduce the precompiled header also in the case of C files?
Bookmarks