mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-28 00:10:21 +08:00
Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt (#3318)
* Added SPDLOG_FWRITE_UNLOCKED option to CMakeLists.txt * Update CMakeLists.txt
This commit is contained in:
parent
ad0f31c009
commit
d71555306a
@ -133,6 +133,7 @@ option(
|
|||||||
"prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently"
|
"prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently"
|
||||||
OFF)
|
OFF)
|
||||||
option(SPDLOG_DISABLE_DEFAULT_LOGGER "Disable default logger creation" OFF)
|
option(SPDLOG_DISABLE_DEFAULT_LOGGER "Disable default logger creation" OFF)
|
||||||
|
option(SPDLOG_FWRITE_UNLOCKED "Use the unlocked variant of fwrite. Leave this on unless your libc doesn't have it" ON)
|
||||||
|
|
||||||
# clang-tidy
|
# clang-tidy
|
||||||
option(SPDLOG_TIDY "run clang-tidy" OFF)
|
option(SPDLOG_TIDY "run clang-tidy" OFF)
|
||||||
@ -241,15 +242,17 @@ endif()
|
|||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
# Check if fwrite_unlocked/_fwrite_nolock is available
|
# Check if fwrite_unlocked/_fwrite_nolock is available
|
||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
include(CheckSymbolExists)
|
if(SPDLOG_FWRITE_UNLOCKED)
|
||||||
if(WIN32)
|
include(CheckSymbolExists)
|
||||||
check_symbol_exists(_fwrite_nolock "stdio.h" HAVE_FWRITE_UNLOCKED)
|
if(WIN32)
|
||||||
else ()
|
check_symbol_exists(_fwrite_nolock "stdio.h" HAVE_FWRITE_UNLOCKED)
|
||||||
check_symbol_exists(fwrite_unlocked "stdio.h" HAVE_FWRITE_UNLOCKED)
|
else ()
|
||||||
endif()
|
check_symbol_exists(fwrite_unlocked "stdio.h" HAVE_FWRITE_UNLOCKED)
|
||||||
if(HAVE_FWRITE_UNLOCKED)
|
endif()
|
||||||
target_compile_definitions(spdlog PRIVATE SPDLOG_FWRITE_UNLOCKED)
|
if(HAVE_FWRITE_UNLOCKED)
|
||||||
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FWRITE_UNLOCKED)
|
target_compile_definitions(spdlog PRIVATE SPDLOG_FWRITE_UNLOCKED)
|
||||||
|
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FWRITE_UNLOCKED)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user