Make use of platform-specific APIs for optimizing CopyHelper configurable
There might be unexpected limitations like https://github.com/Martchus/cpp-utilities/issues/24. To be able to at least workaround those limitations it makes sense to allow disabling the optimization completely.
This commit is contained in:
parent
10a7e4d814
commit
2467c4f815
|
@ -195,6 +195,12 @@ if (NOT ENABLE_THREAD_LOCAL)
|
|||
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_NO_THREAD_LOCAL)
|
||||
endif ()
|
||||
|
||||
# configure use of platform-specific APIs for optimizing CopyHelper
|
||||
option(USE_PLATFORM_SPECIFIC_API_FOR_OPTIMIZING_COPY_HELPER "enables use of platform-specific APIs for optimizing CopyHelper" ON)
|
||||
if (USE_PLATFORM_SPECIFIC_API_FOR_OPTIMIZING_COPY_HELPER)
|
||||
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_USE_PLATFORM_SPECIFIC_API_FOR_OPTIMIZING_COPY_HELPER)
|
||||
endif ()
|
||||
|
||||
# include modules to apply configuration
|
||||
include(BasicConfig)
|
||||
include(WindowsResources)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define IOUTILITIES_COPY_H
|
||||
|
||||
#include "./nativefilestream.h"
|
||||
#if defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER) && defined(PLATFORM_LINUX)
|
||||
#if defined(CPP_UTILITIES_USE_PLATFORM_SPECIFIC_API_FOR_OPTIMIZING_COPY_HELPER) && defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER) && defined(PLATFORM_LINUX)
|
||||
#define CPP_UTILITIES_USE_SEND_FILE
|
||||
#include "../conversion/stringbuilder.h"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue