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)