diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-09-16 12:54:45 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-10-06 05:51:54 +0000 |
commit | cb08b40976150b679d2978f82e3b7ba7c1732780 (patch) | |
tree | 2aee35de3bca6e16ab02f57ecb9576177c93e9dd /src/corelib/configure.json | |
parent | db1027bc360cb86526d95dd0d7f36107a4d36b47 (diff) |
Move detection of <future> to a configure test
<future> is needed by QThread::create. Instead of a fragile series
of preprocessor tests, move its detection to a configure test.
This dramatically simplifies the code, but on the other hand ties
the availability of QThread::create() to the system used to compile
Qt (rather the one used to compile an application).
Change-Id: If1b06363379bf29126cfa68f2a0651cbb78a67f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/configure.json')
-rw-r--r-- | src/corelib/configure.json | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 3feda2fffc..51e6d1d391 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -251,6 +251,18 @@ ] } }, + "cxx11_future": { + "label": "C++11 <future>", + "type": "compile", + "test": { + "include": "future", + "main": [ + "std::future<int> f = std::async([]() { return 42; });", + "(void)f.get();" + ], + "qmake": "unix:LIBS += -lpthread" + } + }, "cxx11_random": { "label": "C++11 <random>", "type": "compile", @@ -442,6 +454,11 @@ "condition": "features.doubleconversion && libs.doubleconversion", "output": [ "privateFeature" ] }, + "cxx11_future": { + "label": "C++11 <future>", + "condition": "tests.cxx11_future", + "output": [ "publicFeature" ] + }, "cxx11_random": { "label": "C++11 <random>", "condition": "tests.cxx11_random", |