From 4fa488fb0159c629483b7994aa84e73926b132b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:33:02 +0200 Subject: Merging upstream version 1:10.11.7. Signed-off-by: Daniel Baumann --- cmake/libfmt.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cmake/libfmt.cmake') diff --git a/cmake/libfmt.cmake b/cmake/libfmt.cmake index 70b6a072..da347942 100644 --- a/cmake/libfmt.cmake +++ b/cmake/libfmt.cmake @@ -1,4 +1,4 @@ -INCLUDE (CheckCXXSourceCompiles) +INCLUDE (CheckCXXSourceRuns) INCLUDE (ExternalProject) SET(WITH_LIBFMT "auto" CACHE STRING @@ -27,17 +27,15 @@ ENDMACRO() MACRO (CHECK_LIBFMT) IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto") SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR}) - CHECK_CXX_SOURCE_COMPILES( + CHECK_CXX_SOURCE_RUNS( "#define FMT_STATIC_THOUSANDS_SEPARATOR ',' #define FMT_HEADER_ONLY 1 #include - #include int main() { - int answer= 42; + int answer= 4321; fmt::format_args::format_arg arg= fmt::detail::make_arg(answer); - std::cout << fmt::vformat(\"The answer is {}.\", - fmt::format_args(&arg, 1)); + return fmt::vformat(\"{:L}\", fmt::format_args(&arg, 1)).compare(\"4,321\"); }" HAVE_SYSTEM_LIBFMT) SET(CMAKE_REQUIRED_INCLUDES) ENDIF() -- cgit v1.2.3