From 8f2fed8d2a1b23a8f318047b6592ad64b6ecbd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Mon, 30 Mar 2015 17:49:26 +0200 Subject: Async: initial support for native chaining of KJobs It is now possible use KJob-derived jobs with libasync without having to write lambda wrappers. auto job = Async::start(); job.exec(arg1, arg2, ...); The reason for this approach (instead of taking KJob* as an argument is that we usually want the KJob ctor arguments to depend on result of previous job. At least in case of Async::start() however it makes sense to support passing KJob* as an argument (not yet implemented). In future we should also support custom error handlers. The KJob integration is build-time optional, but enabled by default (pass -DWITH_KJOB=FALSE to CMake to disable). Adds KCoreAddons dependency. --- async/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'async/CMakeLists.txt') diff --git a/async/CMakeLists.txt b/async/CMakeLists.txt index 19ac407..a6b53f8 100644 --- a/async/CMakeLists.txt +++ b/async/CMakeLists.txt @@ -1,2 +1,12 @@ +project(libasync) + +option(WITH_KJOB "Enable native support for KJob in libasync API (enabled by default)" ON) + +if (WITH_KJOB) + set(MINUMUM_FRAMEWORKS_VERSION "5.8.0") + find_package(KF5CoreAddons REQUIRED ${MINUMUM_FRAMEWORKS_VERSION}) + add_definitions(-DWITH_KJOB) +endif() + add_subdirectory(src) add_subdirectory(autotests) \ No newline at end of file -- cgit v1.2.3