mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-29 04:07:47 +01:00
Silence the discarded isalpha result warning in fmt on MSVC
fmt 12.1.0 calls std::isalpha in locale_ref's constructor only to check that it is found via ADL, and discards the result. MSVC's standard library marks the function [[nodiscard]], so compiling fmt's format.cc gives C4834. Disable that warning for the fetched fmt target only.
This commit is contained in:
1 parent
f4b6ef61d5
commit
a7f5d0c348
1 file changed
+5
@@ -208,6 +208,11 @@ if(AARE_FETCH_FMT)
|
||||
CACHE BOOL "")
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
if(MSVC)
|
||||
# fmt 12.1.0 calls std::isalpha only to check that ADL finds it and drops
|
||||
# the result, which MSVC's standard library marks [[nodiscard]]
|
||||
target_compile_options(fmt PRIVATE /wd4834)
|
||||
endif()
|
||||
else()
|
||||
find_package(fmt 8 REQUIRED)
|
||||
endif()
|
||||
|
||||
Reference in new issue
Block a user