From 057510c7617d49de96b0e5627972241d8cb190bf Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 23 May 2024 13:53:09 +0200 Subject: [PATCH] Use check_cxx_source_compiles to validate std::format Signed-off-by: Uilian Ries --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c97a2998..2b359c9ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,9 @@ project(${PROJECT_NAME} CXX) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -include(CheckIncludeFileCXX) -CHECK_INCLUDE_FILE_CXX("format" HAS_STD_FORMAT) +include(CheckCXXSourceCompiles) +set(CMAKE_REQUIRED_FLAGS -std=c++20) +check_cxx_source_compiles("#include \nint main(){ auto var = std::format(\"{}\", \"Hello\"); return 0; }" HAS_STD_FORMAT) option(BUILD_FAKER_TESTS DEFAULT ON)