diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f7939e0..604416c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,10 +353,9 @@ else() check_have_libdispatch(WITH_LIBDISPATCH dispatch) if(LLFIO_HAS_LIBDISPATCH_WITH_LIBDISPATCH) all_link_libraries(PUBLIC dispatch) + all_compile_definitions(PUBLIC LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD=1) endif() endif() - else() - all_compile_definitions(PUBLIC LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD=0) endif() if(NOT LLFIO_HAS_LIBDISPATCH_BUILTIN AND NOT LLFIO_HAS_LIBDISPATCH_WITH_LIBDISPATCH AND (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)) indented_message(FATAL_ERROR "FATAL: Grand Central Dispatch as libdispatch was not found on this FreeBSD or Mac OS system. libdispatch is required for LLFIO to build on those systems.") diff --git a/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp b/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp index 240d5947..71a5096c 100644 --- a/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp +++ b/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp @@ -39,31 +39,19 @@ Distributed under the Boost Software License, Version 1.0. #include -#ifndef LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD -#if LLFIO_FORCE_USE_LIBDISPATCH -#include -#define LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD 1 -#else -#ifdef _WIN32 +#if defined(_WIN32) #include "windows/import.hpp" #include -#else -#if __has_include() -#include -#define LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD 1 -#endif -#endif -#endif -#endif -#if !LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD && !defined(_WIN32) -#if !defined(__linux__) -#error dynamic_thread_pool_group requires Grand Central Dispatch (libdispatch) on non-Linux POSIX. -#endif +#elif defined(__linux__) && !LLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD #include /* Defines DT_* constants */ #include #include #include +#elif __has_include() +#include +#else +#error dynamic_thread_pool_group requires Grand Central Dispatch (libdispatch) on non-Linux POSIX. #endif #define LLFIO_DYNAMIC_THREAD_POOL_GROUP_PRINTING 0