diff options
author | gabime <gmelman1@gmail.com> | 2019-08-09 10:31:53 +0300 |
---|---|---|
committer | gabime <gmelman1@gmail.com> | 2019-08-09 10:31:53 +0300 |
commit | 8cc0997f796d2295b0ccc9caaf0abcca25d89525 (patch) | |
tree | 1b2e275dcaeb7f170bc7e593e5387668f2b851c4 /CMakeLists.txt | |
parent | ffb7c317b5799936ea5f05f71e0909a9cae380c5 (diff) |
Added SPDLOG_WCHAR_SUPPORT options to CMake under windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 038584a5..b3e710df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,11 @@ option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF) option(SPDLOG_INSTALL "Generate the install target." ${SPDLOG_MASTER_PROJECT}) option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF) +if(WIN32) + option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF) +endif() + + find_package(Threads REQUIRED) message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) @@ -109,6 +114,12 @@ if(SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) endif() +if(SPDLOG_WCHAR_SUPPORT) + target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT) + target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT) + endif() + + #--------------------------------------------------------------------------------------- # Build binaries #--------------------------------------------------------------------------------------- |