From 8a3eebec5304735c06cf0828ce783e24d05ddd44 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Sat, 29 Jun 2024 20:30:49 +0200 Subject: [PATCH] Avoid cmake expression-generator Signed-off-by: Uilian Ries --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e06b0673f..6e29067ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,11 @@ project(faker-cxx LANGUAGES CXX) include(cmake/CompilerWarnings.cmake) -set(CMAKE_REQUIRED_FLAGS "$<$:/std:c++20>$<$>:-std=c++20>") +if (MSVC) + set(CMAKE_REQUIRED_FLAGS /std:c++20) +else() + set(CMAKE_REQUIRED_FLAGS -std=c++20) +endif() include(CheckCXXSourceCompiles) check_cxx_source_compiles("#include \nint main(){ auto var = std::format(\"{}\", \"Hello\"); return 0; }" HAS_STD_FORMAT)