mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
Better support for FMT_UNICODE in cmake
This commit is contained in:
parent
7a950e028c
commit
d373093734
@ -33,9 +33,9 @@ elseif(NOT CMAKE_CXX_STANDARD)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# under msvc make sure __cplusplus, parallel build and utf-8 enabled
|
# under msvc make sure __cplusplus, parallel build
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /MP /utf-8")
|
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /MP")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
@ -283,7 +283,20 @@ if(SPDLOG_NO_EXCEPTIONS)
|
|||||||
target_compile_options(spdlog PRIVATE /EHs-c-)
|
target_compile_options(spdlog PRIVATE /EHs-c-)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
|
# {fmt} lib requires /utf-8 flag or FMT_UNICODE=0 under MSVC
|
||||||
|
# ---------------------------------------------------------------------------------------
|
||||||
|
if(NOT SPDLOG_USE_STD_FORMAT)
|
||||||
|
if(MSVC)
|
||||||
|
if(SPDLOG_WCHAR_SUPPORT OR SPDLOG_WCHAR_CONSOLE)
|
||||||
|
target_compile_options(spdlog PUBLIC /utf-8)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(spdlog PUBLIC FMT_UNICODE=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Build binaries
|
# Build binaries
|
||||||
# ---------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------
|
||||||
if(SPDLOG_BUILD_EXAMPLE OR SPDLOG_BUILD_EXAMPLE_HO OR SPDLOG_BUILD_ALL)
|
if(SPDLOG_BUILD_EXAMPLE OR SPDLOG_BUILD_EXAMPLE_HO OR SPDLOG_BUILD_ALL)
|
||||||
|
Loading…
Reference in New Issue
Block a user