Skip to content

Commit

Permalink
Don't use dispatch if we can't build it
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Dec 29, 2021
1 parent 3fde21b commit 753514c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,21 @@ PUBLIC
${src_loc}
)

if (LINUX)
if (TARGET desktop-app::external_dispatch)
target_link_libraries(lib_crl
PUBLIC
desktop-app::external_dispatch
)
endif()

if (LINUX)
target_link_libraries(lib_crl
PUBLIC
pthread
)
endif()

if (build_macstore OR LINUX)
if (build_macstore OR TARGET desktop-app::external_dispatch)
target_compile_definitions(lib_crl
PUBLIC
CRL_USE_COMMON_QUEUE
Expand Down
4 changes: 2 additions & 2 deletions crl/common/crl_common_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define CRL_USE_WINAPI_LIST
#endif // !CRL_FORCE_STD_LIST

#elif !defined CRL_FORCE_QT // _MSC_VER && !CRL_FORCE_QT
#elif __has_include(<dispatch/dispatch.h>) && !defined CRL_FORCE_QT // _MSC_VER && !CRL_FORCE_QT

// gcc compatibility
#ifndef __has_feature
Expand All @@ -47,7 +47,7 @@
#define CRL_USE_DISPATCH
#define CRL_USE_COMMON_LIST

#elif __has_include(<QtCore/QThreadPool>) // !CRL_FORCE_QT
#elif __has_include(<QtCore/QThreadPool>) // dispatch && !CRL_FORCE_QT

#define CRL_USE_QT
#define CRL_USE_COMMON_LIST
Expand Down

0 comments on commit 753514c

Please sign in to comment.