diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-18 11:13:25 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-03-03 19:05:11 -0800 |
commit | 6358bc9331a961b882173367e9483f4eb4ca4783 (patch) | |
tree | 0a9b47ea8dd4d10a42b2a906d1316aa32fc6d797 /src/corelib | |
parent | 50132fb54b6e1b8b9f405eb42f6088d8ec7b3f3c (diff) |
Logging: rejiggle the way we detect the availability of backtrace() API
We had proper CMake tests for all we needed, so we can drop the old
detection we were forced to use way back when. Said test (CMake's own
FindBacktrace.cmake) even found QNX's offering, which we reported as
"yes" in our configure output, but never actually used because it was a
different API. Now we'll report "no" for QNX.
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f73cfe4cf38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/corelib/configure.cmake | 4 | ||||
-rw-r--r-- | src/corelib/global/qlogging.cpp | 21 |
3 files changed, 11 insertions, 16 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 89abd8d863..c39c2c4c86 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -703,6 +703,8 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_commandlineparser ) qt_internal_extend_target(Core CONDITION QT_FEATURE_backtrace + DEFINES + BACKTRACE_HEADER="${Backtrace_HEADER}" LIBRARIES WrapBacktrace::WrapBacktrace ) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 82bc03a4fd..249e84cb01 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -14,7 +14,9 @@ set_property(CACHE INPUT_libb2 PROPERTY STRINGS undefined no qt system) #### Libraries -if((UNIX) OR QT_FIND_ALL_PACKAGES_ALWAYS) +if((UNIX AND NOT QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + # QNX's libbacktrace has an API wholly different from all the other Unix + # offerings qt_find_package(WrapBacktrace PROVIDED_TARGETS WrapBacktrace::WrapBacktrace MODULE_NAME core QMAKE_LIB backtrace) endif() qt_find_package(WrapDoubleConversion PROVIDED_TARGETS WrapDoubleConversion::WrapDoubleConversion MODULE_NAME core QMAKE_LIB doubleconversion) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 0049f5ef35..c369259788 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> -** Copyright (C) 2018 Intel Corporation. +** Copyright (C) 2022 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -107,14 +107,11 @@ extern char *__progname; #endif #ifndef QT_BOOTSTRAPPED -#if QT_CONFIG(regularexpression) -# ifdef __UCLIBC__ -# if __UCLIBC_HAS_BACKTRACE__ -# define QLOGGING_HAVE_BACKTRACE -# endif -# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>)) -# define QLOGGING_HAVE_BACKTRACE -# endif +#if __has_include(<cxxabi.h>) && QT_CONFIG(backtrace) && QT_CONFIG(regularexpression) +# include <qregularexpression.h> +# include BACKTRACE_HEADER +# include <cxxabi.h> +# define QLOGGING_HAVE_BACKTRACE #endif #if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>)) @@ -152,12 +149,6 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid() return qintptr(QThread::currentThreadId()); } #endif - -#ifdef QLOGGING_HAVE_BACKTRACE -# include <qregularexpression.h> -# include <cxxabi.h> -# include <execinfo.h> -#endif #endif // !QT_BOOTSTRAPPED #include <cstdlib> |