Enable correct __cplusplus macro when building with MSVC

This commit is contained in:
Scott Ramsby 2020-03-23 10:31:51 -07:00
parent 08ca40ea91
commit 51c860de90
2 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,10 @@ set(FMT_SOURCES src/format.cc src/os.cc)
add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS} README.rst ChangeLog.rst)
add_library(fmt::fmt ALIAS fmt)
if (MSVC)
target_compile_options(fmt PRIVATE /Zc:__cplusplus)
endif ()
if (HAVE_STRTOD_L)
target_compile_definitions(fmt PUBLIC FMT_LOCALE)
endif ()

View File

@ -97,6 +97,7 @@ add_fmt_test(gtest-extra-test)
add_fmt_test(format-test mock-allocator.h)
if (MSVC)
target_compile_options(format-test PRIVATE /bigobj)
target_compile_options(format-test PRIVATE /Zc:__cplusplus)
endif ()
if (NOT (MSVC AND BUILD_SHARED_LIBS))
add_fmt_test(format-impl-test)