Skip to content

Commit

Permalink
Merge f3371cc into a74411e
Browse files Browse the repository at this point in the history
  • Loading branch information
ned14 authored Feb 24, 2021
2 parents a74411e + f3371cc commit ac5cb61
Show file tree
Hide file tree
Showing 21 changed files with 4,174 additions and 198 deletions.
28 changes: 27 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include(QuickCppLibUtils)
include(QuickCppLibPolicies)

option(LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE "Whether to use SG14 status_code for failure handling" OFF)
option(LLFIO_DISABLE_LIBDISPATCH "Whether to disable automatic discovery of libdispatch/Grand Unified Dispatch" OFF)
option(LLFIO_ENABLE_DEPENDENCY_SMOKE_TEST "Whether to build executables which are smoke tests that LLFIO is fully working. Used by various package managers such as vcpkg." OFF)
option(LLFIO_ASSUME_CROSS_COMPILING "Whether to assume we are cross compiling. Normally automatically detected, but if automatic detection doesn't work, a working <filesystem> will not be found during cmake configure." OFF)
option(UNIT_TESTS_BUILD_ALL "Whether to run all of the unit test suite." OFF)
Expand Down Expand Up @@ -283,6 +284,30 @@ int main() {
all_compile_definitions(PUBLIC LLFIO_FORCE_EXPERIMENTAL_FILESYSTEM=1 KERNELTEST_FORCE_EXPERIMENTAL_FILESYSTEM=1)
endif()
endif()
# Do we have Grand Central Dispatch on this platform?
if(NOT LLFIO_DISABLE_LIBDISPATCH)
function(check_have_libdispatch postfix)
set(CMAKE_REQUIRED_LIBRARIES ${ARGN})
check_cxx_source_compiles("
#include <dispatch/dispatch.h>
int main() {
return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) != nullptr;
}
" LLFIO_HAS_LIBDISPATCH_${postfix})
endfunction()
check_have_libdispatch(BUILTIN)
if(NOT LLFIO_HAS_LIBDISPATCH_BUILTIN)
check_have_libdispatch(WITH_LIBDISPATCH dispatch)
if(LLFIO_HAS_LIBDISPATCH_WITH_LIBDISPATCH)
all_link_libraries(PUBLIC dispatch)
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.")
endif()

# Set any macros this library requires
all_compile_definitions(PRIVATE LLFIO_INCLUDE_STORAGE_PROFILE=1 LLFIO_ENABLE_TEST_IO_MULTIPLEXERS=1)
Expand All @@ -293,7 +318,8 @@ if(LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE)
all_compile_definitions(PUBLIC LLFIO_EXPERIMENTAL_STATUS_CODE=1)
endif()
if(WIN32)
all_compile_definitions(PRIVATE _WIN32_WINNT=0x601) ## Target Win7
all_compile_definitions(PRIVATE _WIN32_WINNT=0x601) ## Target Win7
target_compile_definitions(llfio_hl INTERFACE _WIN32_WINNT=0x601) ## Target Win7
if(NOT LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE)
target_link_libraries(llfio_hl INTERFACE ntkernel-error-category::hl)
target_link_libraries(llfio_dl PUBLIC ntkernel-error-category::dl)
Expand Down
2 changes: 2 additions & 0 deletions cmake/headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(llfio_HEADERS
"include/llfio/v2.0/detail/impl/cached_parent_handle_adapter.ipp"
"include/llfio/v2.0/detail/impl/clone.ipp"
"include/llfio/v2.0/detail/impl/config.ipp"
"include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp"
"include/llfio/v2.0/detail/impl/fast_random_file_handle.ipp"
"include/llfio/v2.0/detail/impl/io_multiplexer.ipp"
"include/llfio/v2.0/detail/impl/path_discovery.ipp"
Expand Down Expand Up @@ -77,6 +78,7 @@ set(llfio_HEADERS
"include/llfio/v2.0/detail/impl/windows/test/iocp_multiplexer.ipp"
"include/llfio/v2.0/detail/impl/windows/utils.ipp"
"include/llfio/v2.0/directory_handle.hpp"
"include/llfio/v2.0/dynamic_thread_pool_group.hpp"
"include/llfio/v2.0/fast_random_file_handle.hpp"
"include/llfio/v2.0/file_handle.hpp"
"include/llfio/v2.0/fs_handle.hpp"
Expand Down
2 changes: 2 additions & 0 deletions cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(llfio_TESTS
"test/tests/directory_handle_create_close/runner.cpp"
"test/tests/directory_handle_enumerate/kernel_directory_handle_enumerate.cpp.hpp"
"test/tests/directory_handle_enumerate/runner.cpp"
"test/tests/dynamic_thread_pool_group.cpp"
"test/tests/fast_random_file_handle.cpp"
"test/tests/file_handle_create_close/kernel_file_handle.cpp.hpp"
"test/tests/file_handle_create_close/runner.cpp"
Expand All @@ -27,6 +28,7 @@ set(llfio_TESTS
"test/tests/section_handle_create_close/kernel_section_handle.cpp.hpp"
"test/tests/section_handle_create_close/runner.cpp"
"test/tests/shared_fs_mutex.cpp"
"test/tests/statfs.cpp"
"test/tests/symlink_handle_create_close/kernel_symlink_handle.cpp.hpp"
"test/tests/symlink_handle_create_close/runner.cpp"
"test/tests/traverse.cpp"
Expand Down
6 changes: 3 additions & 3 deletions include/llfio/revision.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define LLFIO_PREVIOUS_COMMIT_REF 74e710643944764a3548847322d6cb9a4a7ed5ab
#define LLFIO_PREVIOUS_COMMIT_DATE "2021-02-23 11:27:11 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE 74e71064
#define LLFIO_PREVIOUS_COMMIT_REF 1cf5addd4a11570624f8faf17491431d7dde5427
#define LLFIO_PREVIOUS_COMMIT_DATE "2021-02-23 12:58:16 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE 1cf5addd
Loading

0 comments on commit ac5cb61

Please sign in to comment.