diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-01 11:01:42 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-02 12:36:18 -0700 |
commit | 4a5f3c8b930d319ce2ecc802a0868164f18034db (patch) | |
tree | 43992b6fe4c68cc13772ad1d6eb7c47fb5aa6425 /src/corelib | |
parent | f44072ca437bc943ac45e4bee69720499a0f8843 (diff) |
CMake: remove check for cxx11_future
Everyone must have this by now. This test was 1193 ms of CMake time.
Since this was a PUBLIC feature, I've left it around with a constant
condition.
Change-Id: Ifbf974a4d10745b099b1fffd177754538bbff245
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/configure.cmake | 23 | ||||
-rw-r--r-- | src/corelib/thread/qthread.cpp | 2 | ||||
-rw-r--r-- | src/corelib/thread/qthread.h | 12 |
3 files changed, 3 insertions, 34 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 6e8de89099..eca3b01886 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -137,27 +137,6 @@ int pipes[2]; } ") -# cxx11_future -if (UNIX AND NOT ANDROID AND NOT QNX AND NOT INTEGRITY) - set(cxx11_future_TEST_LIBRARIES pthread) -endif() -qt_config_compile_test(cxx11_future - LABEL "C++11 <future>" - LIBRARIES - "${cxx11_future_TEST_LIBRARIES}" - CODE -"#include <future> - -int main(void) -{ - /* BEGIN TEST: */ -std::future<int> f = std::async([]() { return 42; }); -(void)f.get(); - /* END TEST: */ - return 0; -} -") - # cxx17_filesystem qt_config_compile_test(cxx17_filesystem LABEL "C++17 <filesystem>" @@ -565,7 +544,7 @@ qt_feature("system-doubleconversion" PRIVATE ) qt_feature("cxx11_future" PUBLIC LABEL "C++11 <future>" - CONDITION TEST_cxx11_future + CONDITION ON ) qt_feature("cxx17_filesystem" PUBLIC LABEL "C++17 <filesystem>" diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 61369420d1..111c6a93d5 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -1201,7 +1201,6 @@ bool QThread::isInterruptionRequested() const \sa start() */ -#if QT_CONFIG(cxx11_future) class QThreadCreateThread : public QThread { public: @@ -1230,7 +1229,6 @@ QThread *QThread::createThreadImpl(std::future<void> &&future) { return new QThreadCreateThread(std::move(future)); } -#endif // QT_CONFIG(cxx11_future) /*! \class QDaemonThread diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index 40f363ee5a..32a0bb703e 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -9,10 +9,8 @@ #include <QtCore/qdeadlinetimer.h> // For QThread::create -#if QT_CONFIG(cxx11_future) -# include <future> // for std::async -# include <functional> // for std::invoke; no guard needed as it's a C++98 header -#endif +#include <future> // for std::async +#include <functional> // for std::invoke; no guard needed as it's a C++98 header // internal compiler error with mingw 8.1 #if defined(Q_CC_MSVC) && defined(Q_PROCESSOR_X86) #include <intrin.h> @@ -70,10 +68,8 @@ public: bool event(QEvent *event) override; int loopLevel() const; -#if QT_CONFIG(cxx11_future) || defined(Q_QDOC) template <typename Function, typename... Args> [[nodiscard]] static QThread *create(Function &&f, Args &&... args); -#endif public Q_SLOTS: void start(Priority = InheritPriority); @@ -112,16 +108,13 @@ private: Q_DECLARE_PRIVATE(QThread) friend class QEventLoopLocker; -#if QT_CONFIG(cxx11_future) [[nodiscard]] static QThread *createThreadImpl(std::future<void> &&future); -#endif static Qt::HANDLE currentThreadIdImpl() noexcept Q_DECL_PURE_FUNCTION; friend class QCoreApplication; friend class QThreadData; }; -#if QT_CONFIG(cxx11_future) template <typename Function, typename... Args> QThread *QThread::create(Function &&f, Args &&... args) { @@ -136,7 +129,6 @@ QThread *QThread::create(Function &&f, Args &&... args) std::move(threadFunction), std::forward<Args>(args)...)); } -#endif // QT_CONFIG(cxx11_future) /* On architectures and platforms we know, interpret the thread control |