qt5base-lts/mkspecs/features/qt_tracepoints.prf
Milian Wolff 63a3b26b6b Fix QMake build system to support trace points in a cross-compiled build
CONFIG(cross_compile) implies CONFIG(force_bootstrap). The latter is
errorneously used within qt_tracepoints.prf and to decide when
tracegen is to be build.

For the tracepoints, we just need to check if etw/lttng trace points
are enabled.

For tracegen, we don't need to check anything - it doesn't depend
on etw or lttng, it is just a code generator similar to moc or rcc
and should be handled like these tools.

Change-Id: I3784b37db10680efd0ed7ee7860059bdf62b4118
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 16:20:08 +02:00

55 lines
1.6 KiB
Plaintext

# W A R N I N G
# -------------
#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#
qtPrepareTool(QMAKE_TRACEGEN, tracegen)
isEmpty(TRACEGEN_DIR): TRACEGEN_DIR = .
PROVIDER_NAME = qt$$lower($$MODULE)
INCLUDEPATH += $$absolute_path($$TRACEGEN_DIR, $$OUT_PWD)
HEADER_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints_p$${first(QMAKE_EXT_H)}
if(qtConfig(lttng)|qtConfig(etw)) {
SOURCE_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints$${first(QMAKE_EXT_CPP)}
isEmpty(BUILDS)|build_pass {
impl_file_contents = \
"$${LITERAL_HASH}define TRACEPOINT_CREATE_PROBES" \
"$${LITERAL_HASH}define TRACEPOINT_DEFINE" \
"$${LITERAL_HASH}include \"$${HEADER_PATH}\""
write_file($$SOURCE_PATH, impl_file_contents)|error()
}
GENERATED_SOURCES += $$SOURCE_PATH
tracegen.input = TRACEPOINT_PROVIDER
tracegen.output = $$HEADER_PATH
tracegen.variable_out = HEADERS
tracegen.depends += $$QMAKE_TRACEGEN_EXE
tracegen.CONFIG = target_predeps
qtConfig(lttng) {
tracegen.commands = $$QMAKE_TRACEGEN lttng ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
QMAKE_USE_PRIVATE += lttng-ust
} else {
tracegen.commands = $$QMAKE_TRACEGEN etw ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
}
QMAKE_EXTRA_COMPILERS += tracegen
DEFINES += Q_TRACEPOINT
} else {
isEmpty(BUILDS)|build_pass {
header_file_contents = "$${LITERAL_HASH}include <private/qtrace_p.h>"
write_file($$HEADER_PATH, header_file_contents)|error()
}
}