Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-01-02 20:33:37 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-03-16 13:21:40 +0300
commit29f262d1b4d918ce1b96b8ab0536ae9fc343e6b3 (patch)
tree25e736b5b4fb80c84cfa4c5f59224c32d1706f45 /CMakeLists.txt
parent02c1625d7d7fda0ed37c48d6aa419943cbeeebb3 (diff)
Hopefully fix failure to find libdispatch on Mac OS. Also hopefully fix test failure on Windows.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 10 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6112775..0a82bd45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -286,23 +286,25 @@ int main() {
endif()
# Do we have Grand Central Dispatch on this platform?
if(NOT LLFIO_DISABLE_LIBDISPATCH)
- function(check_have_libdispatch)
- set(CMAKE_REQUIRED_LIBRARIES dispatch)
+ function(check_have_libdispatch postfix)
+ set(CMAKE_REQUIRED_LIBRARIES ${ARGN})
check_cxx_source_compiles("
#include <dispatch/dispatch.h>
int main() {
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
return 0;
}
-" LLFIO_HAS_LIBDISPATCH)
+" LLFIO_HAS_LIBDISPATCH_${postfix})
endfunction()
- check_have_libdispatch()
- if(LLFIO_HAS_LIBDISPATCH)
- all_compile_definitions(PUBLIC LLFIO_FORCE_USE_LIBDISPATCH=1)
- all_link_libraries(PUBLIC dispatch)
+ check_have_libdispatch(BUILTIN)
+ if(NOT LLFIO_HAS_LIBDISPATCH_BUILTIN)
+ check_have_libdispatch(WITH_LIBDISPATCH)
+ if(LLFIO_HAS_LIBDISPATCH_WITH_LIBDISPATCH)
+ all_link_libraries(PUBLIC dispatch)
+ endif()
endif()
endif()
-if(NOT LLFIO_HAS_LIBDISPATCH AND (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE))
+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.")
endif()